Example: Basic Code to use Javascript Split SDK 10.3.3
Environment:
- Angular 5.0.0
- Node Module (npm): 5.6.0
How to use:
Run the commands below to download dependencies:
-
npm install
-
npm install -g @angular/cli
Update relevant code:
- Update your relevant Split API Key, Track type and feature flag names in: ./src/app/splitio.service.ts
-
Lookup the following section for SDK API and Track type: private _initSdk(): void { this._factory = SplitFactory({ core: { authorizationKey: '[API KEY here]', key: 'Tracke type' },
-
If the second feature flag has different Traffic Type, add the second traffic type here: // and the one for a different key. This will share resources with the main one but segment data. this._splitAccountClient = this._factory.client('[Second Traffic Type]');
-
Lookup the line below and update the feature flag names needed: userFeatures: string[] = [ '[Split1]', '[Split2]'
Command to start: npm start
HTTP Access: http://localhost:4200/
Comments
0 comments
Please sign in to leave a comment.