registerApp

registerApp

Function
registerApp(requestOptionsIRegisterAppOptions): Promise<IApp>

Used to register an app. See the REST Documentation for more information.

Accepted app types:

  • apikey
  • multiple
  • browser
  • server
  • native
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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: [Privileges.Geocode, Privileges.FeatureReport],
  authentication: authSession
}).then((registeredApp: IApp) => {
  // => {client_id: "xyz_id", client_secret: "xyz_secret", ...}
}).catch(e => {
  // => an exception object
});
Parameters
ParameterTypeNotes
requestOptions
IRegisterAppOptions

Options for registerApp | registerApp(), including necessary params to register an app and an ArcGISIdentityManager authentication session.

Returns 
Promise<IApp>

A Promise that will resolve to an IApp object representing the newly registered app.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.