@esri/arcgis-rest-auth
Version:
Authentication helpers for @esri/arcgis-rest-js.
27 lines (26 loc) • 645 B
TypeScript
import { IAuthenticationManager } from "@esri/arcgis-rest-request";
/**
* Options for the `ApiKey` constructor.
*/
export interface IApiKeyOptions {
key: string;
}
/**
* ```js
* import { ApiKey } from '@esri/arcgis-rest-auth';
* const apiKey = new ApiKey("...");
* ```
* Used to authenticate with API Keys.
*/
export declare class ApiKey implements IAuthenticationManager {
/**
* The current portal the user is authenticated with.
*/
readonly portal: string;
private key;
constructor(options: IApiKeyOptions);
/**
* Gets a token (the API Key).
*/
getToken(url: string): Promise<string>;
}