rethinkdb / horizon-docs

Other
24 stars 36 forks source link

Horizon API: constructor now accepts a JWT token #78

Closed mglukhovsky closed 8 years ago

mglukhovsky commented 8 years ago

The Horizon object now accepts a JWT token, which makes it easier to integrate with non-browser-based authentication methods in environments like React Native.

You can also use a token from hz make-token and provide it directly to the Horizon object.

deontologician commented 8 years ago

The format of this is:

var hz = Horizon({ authType: { token: <TOKEN_HERE> , storeLocally: true|false }})

storeLocally is whether to store the token in localStorage or not (default true). If you set storeLocally to false, you'll need to re-authenticate every time you create a Horizon object.