Skip to content

Commit 4123df0

Browse files
committed
update flagsmith plugin
1 parent 8784762 commit 4123df0

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

examples/nuxt/plugins/flagsmith-plugin.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,18 @@ import flagsmith from 'flagsmith'
33
const plugin: Plugin = async ({beforeNuxtRender, app, nuxtState}, inject) => {
44
if (process.server) {
55
beforeNuxtRender(async ({nuxtState}) => {
6-
console.log("fetch is", fetch)
76
const nodeFetch = require('node-fetch').default
87
await flagsmith.init({
98
environmentID: 'QjgYur4LQTwe5HpvbvhpzK',
109
fetch: nodeFetch,
1110
enableLogs: true,
1211
api: 'https://api.flagsmith.com/api/v1/'
1312
})
14-
try {
15-
await flagsmith.getFlags()
16-
17-
} catch(e) {
18-
console.log(e)
19-
}
20-
console.log(flagsmith.getState())
2113
nuxtState.flagsmith = flagsmith.getState()
2214
})
2315
}
2416

2517
if (process.client) {
26-
console.log('hi')
2718
if (nuxtState.flagsmith) {
2819
// @ts-expect-error
2920
flagsmith.setState(nuxtState.flagsmith)

0 commit comments

Comments
 (0)