-
Notifications
You must be signed in to change notification settings - Fork 429
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Fix missing js client functions (#3250)
- Loading branch information
1 parent
28459c5
commit 1e1764f
Showing
1 changed file
with
2 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 |
---|---|---|
|
@@ -256,12 +256,14 @@ All function and property types can be seen | |
| <code>getTrait(key:string)=> string|number|boolean</code> | Once used with an identified user you can get the value of any trait that is set for them e.g. `flagsmith.getTrait("accepted_cookie_policy")` | | ||
| <code>getAllTraits()=> Record<string,string|number|boolean></code> | Once used with an identified user you can get a key value pair of all traits that are set for them e.g. `flagsmith.getTraits()` | | ||
| <code>getState()=>IState</code> | Retrieves the current state of flagsmith, useful in NextJS / isomorphic applications. `flagsmith.getState()` | | ||
| <code>setState(state: IState)=>void</code> | Set the current state of flagsmith, [useful in NextJS / isomorphic applications.](/clients/next-ssr#comparing-ssr-and-client-side-flagsmith-usage) e.g. `flagsmith.setState({identity: '[email protected]'})`. | | ||
| <code>setTrait(key:string, value:string|number|boolean)=> Promise<IFlags></code> | Once used with an identified user you can set the value of any trait relevant to them e.g. `flagsmith.setTrait("accepted_cookie_policy", true)` | | ||
| <code>setTraits(values:Record\<string, string|number|boolean>)=\> Promise<IFlags></code> | Set multiple traits e.g. `flagsmith.setTraits({foo:"bar",numericProp:1,boolProp:true})`. Setting a value of null for a trait will remove that trait. | | ||
| <code>incrementTrait(key:string, value:number)=> Promise<IFlags></code> | You can also increment/decrement a particular trait them e.g. `flagsmith.incrementTrait("click_count", 1)` | | ||
| <code>startListening(ticks=1000:number)=>void</code> | Poll the api for changes every x milliseconds | | ||
| <code>stopListening()=>void</code> | Stop polling the api | | ||
| <code>getFlags()=> Promise<IFlags></code> | Trigger a manual fetch of the environment features, if a user is identified it will fetch their features. Resolves a promise when the flags are updated. | | ||
| <code>getAllFlags()=> <IFlags></code> | Returns the current flags. | | ||
| <code>identify(userId:string, traits?:Record\<string, string or number or boolean\>)=> Promise<IFlags></code> | Identify as a user, optionally with traits e.g. `{foo:"bar",numericProp:1,boolProp:true}`. This will create a user for your environment in the dashboard if they don't exist, it will also trigger a call to `getFlags()`, resolves a promise when the flags are updated. | | ||
| <code>logout()=>Promise<IFlags></code> | Stop identifying as a user, this will trigger a call to `getFlags()` | | ||
|
||
|
1e1764f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
docs – ./docs
docs.bullet-train.io
docs-git-main-flagsmith.vercel.app
docs.flagsmith.com
docs-flagsmith.vercel.app
1e1764f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
flagsmith-frontend-staging – ./frontend
flagsmith-staging-frontend.vercel.app
staging.flagsmith.com
flagsmith-frontend-staging-flagsmith.vercel.app
flagsmith-frontend-staging-git-main-flagsmith.vercel.app
1e1764f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
flagsmith-frontend-preview – ./frontend
flagsmith-frontend-preview-flagsmith.vercel.app
flagsmith-frontend-preview-git-main-flagsmith.vercel.app
flagsmith-frontend-production-native.vercel.app