The access token used when requesting a new access token.
The access token as a string or null
.
Perform operations related to the API-key auth provider.
An ApiKeyAuth object that can be used to manage API keys.
You can store arbitrary data about your application users in a MongoDB collection and configure Atlas App Services to automatically expose each user’s data in a field of their user object. For example, you might store a user’s preferred language, date of birth, or their local timezone.
If this value has not been configured, it will be empty.
The custom data as an object.
The ID of the device.
The device ID as a string or null
.
Use this to call functions defined by the Atlas App Services application, as this user.
A UserFunctionsFactoryType that can be used to call the app's functions.
The automatically-generated internal ID of the user.
The user ID as a string.
The identities of the user at any of the app's authentication providers.
An array of UserIdentity objects.
The logged in state of the user.
true
if the user is logged in, false
otherwise.
A profile containing additional information about the user.
The user profile data as an object.
The provider type used when authenticating the user. If multiple identities exist, the provider type for the first identity found is return.
The provider type as an enumerated string.
Use identities instead.
The refresh token used when requesting a new access token.
The refresh token as a string or null
.
Adds a listener that will be fired on various user related events. This includes auth token refresh, refresh token refresh, refresh custom user data, and logout.
The callback to be fired when the event occurs.
Call a remote Atlas App Services Function by its name.
Name of the App Services Function.
Rest
...args: unknown[]Arguments passed to the Function.
A promise that resolves to the value returned by the Function.
Consider using functions[name]()
instead of calling this method.
// These are all equivalent:
await user.callFunction("doThing", a1, a2, a3);
await user.functions.doThing(a1, a2, a3);
await user.functions["doThing"](a1, a2, a3);
// The methods returned from the functions object are bound, which is why it's okay to store the function in a variable before calling it:
const doThing = user.functions.doThing;
await doThing(a1);
await doThing(a2);
Link the user with an identity represented by another set of credentials.
The credentials to use when linking.
A promise that resolves once the user has been linked with the credentials.
The name of the MongoDB service to connect to.
A client enabling access to a MongoDB service.
let blueWidgets = user.mongoClient("myService")
.db("myDb")
.collection<Widget>("widgets")
.find({ color: "blue" });
Use the Push service to enable sending push messages to this user via Firebase Cloud Messaging (FCM).
A PushClient with methods to register and deregister the device on the user.
Refresh the access token and derive custom data from it.
A promise that resolves to the refreshed custom data.
Removes all event listeners previously added via User.addListener.
Removes an event listener previously added via User.addListener.
The callback to be removed.
Generated using TypeDoc
Representation of an authenticated user of an App.