-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 1dd4a88
Showing
11 changed files
with
11,427 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Nuxt dev/build outputs | ||
.output | ||
.data | ||
.nuxt | ||
.nitro | ||
.cache | ||
dist | ||
|
||
# Node dependencies | ||
node_modules | ||
|
||
# Logs | ||
logs | ||
*.log | ||
|
||
# Misc | ||
.DS_Store | ||
.fleet | ||
.idea | ||
|
||
# Local env files | ||
.env | ||
.env.* | ||
!.env.example |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
shamefully-hoist=true | ||
strict-peer-dependencies=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# featurevisor-example-nuxt | ||
|
||
Look at the [Nuxt 3 documentation](https://nuxt.com/docs/getting-started/introduction) to learn more. | ||
|
||
For Featurevisor documentation, visit [https://featurevisor.com](https://featurevisor.com). | ||
|
||
## Setup | ||
|
||
Make sure to install the dependencies: | ||
|
||
``` | ||
$ npm install | ||
``` | ||
|
||
## Development Server | ||
|
||
Start the development server on `http://localhost:3000`: | ||
|
||
``` | ||
$ npm run dev | ||
``` | ||
|
||
## Production | ||
|
||
Build the application for production: | ||
|
||
``` | ||
$ npm run build | ||
``` | ||
|
||
Locally preview production build: | ||
|
||
``` | ||
$ npm run preview | ||
``` | ||
|
||
Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<script setup lang="ts"> | ||
import { getInstance } from "./featurevisor"; | ||
const f = await getInstance(); | ||
const featureKey = "my_feature"; | ||
const context = {}; | ||
const isEnabled = f.isEnabled(featureKey, context); | ||
</script> | ||
|
||
<template> | ||
<div class="container"> | ||
<h2>Featurevisor and Nuxt integration example</h2> | ||
|
||
<p v-if="isEnabled">Feature is enabled!</p> | ||
<p v-else>Feature is disabled :(</p> | ||
|
||
<p>Learn more at <a href="https://featurevisor.com">https://featurevisor.com</a></p> | ||
</div> | ||
</template> | ||
|
||
<style> | ||
.container { | ||
font-family: sans-serif; | ||
text-align: center; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { createInstance, FeaturevisorInstance } from "@featurevisor/sdk"; | ||
|
||
const DATAFILE_URL = | ||
"https://featurevisor-example-cloudflare.pages.dev/production/datafile-tag-all.json"; | ||
|
||
let instance: FeaturevisorInstance; | ||
|
||
export async function getInstance() { | ||
if (instance) { | ||
return instance; | ||
} | ||
|
||
const f = createInstance({ | ||
datafileUrl: DATAFILE_URL, | ||
}); | ||
|
||
instance = await f.onReady(); | ||
|
||
return instance; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// https://nuxt.com/docs/api/configuration/nuxt-config | ||
export default defineNuxtConfig({ | ||
devtools: { enabled: true } | ||
}) |
Oops, something went wrong.