registerApp
FunctionregisterApp(requestOptions: IRegisterAppOptions): Promise<IApp>
Used to register an app. See the REST Documentation for more information.
Accepted app types:
- apikey
- multiple
- browser
- server
- native
import { registerApp, IApp } from '@esri/arcgis-rest-developer-credentials';
import { ArcGISIdentityManager } from "@esri/arcgis-rest-request";
const authSession: ArcGISIdentityManager = await ArcGISIdentityManager.signIn({
username: "xyz_usrName",
password: "xyz_pw"
});
registerApp({
itemId: "xyz_itemId",
appType: "multiple",
redirect_uris: ["http://localhost:3000/"],
httpReferrers: ["http://localhost:3000/"],
privileges: ["premium:user:geocode:temporary", Privileges.FeatureReport],
authentication: authSession
}).then((registeredApp: IApp) => {
// => {client_id: "xyz_id", client_secret: "xyz_secret", ...}
}).catch(e => {
// => an exception object
});
Parameters
Parameter | Type | Notes |
---|---|---|
request | IRegisterAppOptions | Options for |
Returns
Promise<IApp>
A Promise that will resolve to an IApp
object representing the newly registered app.