Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for /v3/connect/tokeninfo endpoint #536

Merged

Conversation

mrashed-dev
Copy link
Contributor

Description

This PR adds support for the /v3/connect/tokeninfo endpoint.

Usage

There are two methods that are part of the Auth resource that allow you to get information on a token; one for the ID token (idTokenInfo) and one for the access token (accessTokenInfo).

import Nylas, { TokenInfoResponse } from "nylas";

const nylas = new Nylas({
  apiKey: 'nylas-api-key',
});

// Get information on an ID token
nylas.auth.idTokenInfo('idToken').then((response) => {
  const idTokenInfo: TokenInfoResponse = response.data;
  // ...
});

// Get information on an access token
nylas.auth.accessTokenInfo('accessToken').then((response) => {
  const accessTokenInfo: TokenInfoResponse = response.data;
  // ...
});

License

I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

@mrashed-dev mrashed-dev merged commit 6fa8419 into main Feb 9, 2024
4 checks passed
@mrashed-dev mrashed-dev deleted the AV-3240-node-sdk-add-support-for-tokeninfo-endpoint branch February 9, 2024 13:56
@mrashed-dev mrashed-dev mentioned this pull request Feb 12, 2024
mrashed-dev added a commit that referenced this pull request Feb 12, 2024
# Changelog
* Added support for `/v3/connect/tokeninfo` endpoint (#536)
* Models can now directly be imported from the top-level `nylas` package (#534)
* Fixed inaccuracies in event and webhook models (#535)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants