The FxAccountsProfileClient.jsm JavaScript module provides a way to fetch Firefox Accounts profile information. The modules uses the Firefox Profiler Server API.
Components.utils.import("resource://gre/modules/FxAccountsProfileClient.jsm");
new FxAccountsProfileClient(Object options);
| fetchProfile(); |
| serverURL | URL | Profiler server URL. |
token |
String | Bearer token. |
Creates and returns a new FxAccountsProfileClient object.
FxAccountsProfileClient FxAccountsProfileClient(
Object options
String serverURL,
String token
);
A newly created FxAccountsProfileClient object implementing the methods described in this article.
let client = new FxAccountsProfileClient({
serverURL: "https://profile.accounts.firefox.com/v1",
token: "FXA_OAUTH_BEARER_TOKEN",
});
client.fetchProfile().then(profile => console.log(profile));
The FxAccountsProfileClient.jsm normalizes request and client errors into FxAccountsProfileClientError object.
Attributes
| name | String | Name of the error FxAccountsProfileClientError |
code |
Number | Status code of the request |
| errno | Number | Error number |
| error | String | Error description |
| message | String | Error message |