@byu-oit-sdk/endpoints
v0.4.0
Published
**Requirements**:
Readme
@byu-oit-sdk/endpoints
Requirements:
- Node.js 18+
- npm v9+
EndPoints
An endpoint dictionary contains all the endpoints necessary to configure OAuth credential providers. The may be used for other credential providers as well as long as those credential providers adhere to the naming conventions of the OAuth credential provider endpoint options. Some endpoint configurations may expose additional endpoints for convenience but additional endpoints are not required (see the model declaration file).
This package exposes several endpoint dictionaries:
Usage
This package can be used to configure credential providers.
import { Client } from '@byu-oit-sdk/client'
import { ClientCredentialsProvider } from '@byu-oit-sdk/credential-provider'
import { tokenEndpoint } from '@byu-oit-sdk/endpoints/api.byu.edu'
const client = new Client({
credentials: new ClientCredentialsProvider({
clientId: '***',
clientSecret: '***',
tokenEndpoint
})
})
/** Now make authenticated HTTP requests with the client */[!IMPORTANT] Packages that consume the credential providers should only fetch the discovery document when provided its uri and the endpoint needed is not already statically configured within the credential provider.
