Hub
Hub class can be used as an entry point to managing content, teams, sites, projects etc, in an organization's Hub.
import {Hub} from '@esri/hub-common';
// create a Hub instance, authenticating as a specific user
// working against arcgis online
const myHub = await Hub.create({authOptions: {username: "casey", password: "jones"}});
myHub.context.currentUser //=> {username: "casey", ...} as IUser
const pavingProject = await myHub.projects.create({name: "12th Street Paving"});
pavingProject.summary = "This is the 2024 planned paving of 12th Street, between 8th and 11th Ave";
await myHub.projects.update(pavingProject);
This is a convenience class. Hub Managers can be created directly, or the underlying functions can be imported an used as need for scenarios where these class structures introduce unwanted complexity
Accessors
Accessor | Type | Notes |
---|---|---|
IArcGISContext |
Get the context |
Methods
Method | Returns | Notes |
---|---|---|
|
Promise<Hub> |
Factory function to construct a new Hub instance. |
Class defined in common/src/Hub.ts:37
Factory function to construct a new Hub instance.