pusher-platform-node
Advanced tools
Changelog
0.14.0 - 2018-09-18
SDKInfo
is now required when instantiating an instance of BaseClient
. This can either be directly provided to the BaseClient
and then the base client provided to an instance of Instance
in the client
key or the options
object that Instance
s initializer takes, or you can provide the SDKInfo
instance to the Instance
initializer in the sdkInfo
key of its options
parametersu: true
claim if no JWT is provided to a call to request
Changelog
0.13.0 - 2018-04-19
authenticateWithRefreshToken
has been added if you want to support the refresh_token
grant type and return refresh tokens as part of the authentication processauthenticate
no longer returns a refresh_token
and no longer accepts the refresh_token
grant typeauthenticate
and authenticateWithRefreshToken
always return an AuthenticationResponse
that looks like this:{
status: number;
headers: Headers;
body: TokenResponse | ErrorBody;
}
where:
status
is the suggested HTTP response status code,headers
are the suggested response headers
,body
holds either the token payload or an appropriate error payload.Here is an example of the expected usage, simplified for brevity:
app.post('/', function (req, res) {
const authPayload = pusher.authenticate(req.body, {});
res.status(authPayload.status).send(authPayload.body);
});