diff --git a/frontend/src/component/onboarding/TestSdkConnection.tsx b/frontend/src/component/onboarding/TestSdkConnection.tsx index 892ade544e53..dab000d04800 100644 --- a/frontend/src/component/onboarding/TestSdkConnection.tsx +++ b/frontend/src/component/onboarding/TestSdkConnection.tsx @@ -141,6 +141,8 @@ export const TestSdkConnection: FC = ({ .replace('', apiKey) .replace('', apiUrl) .replaceAll('', feature); + const [connectSnippet, _productionSnippet, _otherResourcesSnippet] = + snippet.split('---\n'); return ( @@ -164,7 +166,7 @@ export const TestSdkConnection: FC = ({ Setup the SDK - {snippet} + {connectSnippet} diff --git a/frontend/src/component/onboarding/snippets/nodejs.md b/frontend/src/component/onboarding/snippets/nodejs.md index e7fbae1f7908..b01f88de824e 100644 --- a/frontend/src/component/onboarding/snippets/nodejs.md +++ b/frontend/src/component/onboarding/snippets/nodejs.md @@ -21,3 +21,21 @@ setInterval(() => { console.log('Is enabled', unleash.isEnabled('')); }, 1000); ``` + +--- +```js +const { UnleashClient } = require('unleash-proxy-client'); + +const unleash = new UnleashClient({ + url: '', + appName: 'unleash-onboarding-node', + customHeaders: { Authorization: process.env.UNLEASH_API_KEY }, +}); + +unleash.start(); +``` + +--- +- [SDK repository with documentation](https://github.com/Unleash/unleash-client-node) +- [Node.js SDK example with CodeSandbox](https://github.com/Unleash/unleash-sdk-examples/tree/main/JavaScript) +- [Node.js SDK tutorial](https://dev.to/reeshee/how-to-implement-feature-flags-in-nodejs-using-unleash-3907)