This directory contains a simple example of how to use Bucket's node-sdk with
Express framework. The example code sets up a Bucket SDK client, starts a
simple REST API service, and uses a set of predefined features to control
a user's access to the API.
The Bucket SDK client is initialized before the API is started and then, instances of the client are bound to each individual user's request, to allow for fetching the relevant features for each request.
To get started, create an app on Bucket and take a note of the secret key which is found under "Settings" -> "Environments".
The following code snippet should be enough to demonstrate the functionality of the SDK:
yarn install
BUCKET_SECRET_KEY=<secretKey> yarn start