We highly recommend to read the documentation profiles page.
More details and API reference: Profiles
| Key | Type | Description |
|---|---|---|
customId | string unique | Unique identifier from your services (1-64 characters) |
.create(customId, rpName, rpNumber)
Create a profile to your iPear server data.
More details and API reference: Create player
| Key | Type | Description |
|---|---|---|
customId | string unique required | Unique identifier from your services (1-64 characters) |
rpName | string required | RolePlay name of the profile (1-64 characters) |
rpNumber | string unique required | Phone number of the profile (1-64 characters) |
Promise<{ customId: string, qrcode: string }>
app.profiles.create("1234", "John Doe", "555-5126").then((player) => {
console.log(player);
}).catch((error) => {
console.log('An error has been occurred!', error);
})
try {
const player = await app.profiles.create("1234", "John Doe", "555-5126");
console.log(player);
} catch (error) {
console.log('An error has been occurred!', error);
}
{
"customId": "1234",
"qrcode": "https://link_to_qrcode.com/4586632.png"
}
.getQrCode(customId)
Retrieve a new QR Code for a profile.
Important
You need to create (/create) a profile before trying to get a new QR Code.
More details and API reference: Retrieve QR Code
| Key | Type | Description |
|---|---|---|
customId | string unique required | Unique identifier from your services (1-64 characters) |
Promise<{ customId: string, qrcode: string }>
app.profiles.getQrCode("1234").then((data) => {
console.log(data);
}).catch((error) => {
console.log('An error has been occurred!', error);
})
try {
const data = await app.profiles.getQrCode("1234");
console.log(data);
} catch (error) {
console.log('An error has been occurred!', error);
}
{
"customId": "1234",
"qrcode": "https://link_to_qrcode.com/544548.png"
}
.getSecretCode(customId)
DEPRECATED since 1.1.0
This feature is now deprecated, and you should use [Profiles] Delete instead.
Retrieve a new secret code for a profile. A secret allows the user to avoid scanning the QR Code. (useful in case that their camera doesn't work)
One code is available for 5 minutes.
Important
You need to create (/create) a profile before trying to get a new secret code.
More details and API reference: Retrieve secret code
| Key | Type | Description |
|---|---|---|
customId | string unique required | Unique identifier from your services (1-64 characters) |
Promise<{ customId: string, code: string, expiresAt: number, expiresAt_date: Date }>
app.profiles.getSecretCode("1234").then((data) => {
console.log(data);
}).catch((error) => {
console.log('An error has been occurred!', error);
})
try {
const data = await app.profiles.getSecretCode("1234");
console.log(data);
} catch (error) {
console.log('An error has been occurred!', error);
}
{
"customId": "1234",
"code": "486327",
"expiresAt": 1682619471476,
"expiresAt_date": Date(1682619471476)
}
.delete(customId)
Delete a profile from your iPear server data.
More details and API reference: Delete player
| Key | Type | Description |
|---|---|---|
customId | string unique required | Unique identifier from your services (1-64 characters) |
Promise<boolean>
app.profiles.delete("1234").then((deleted) => {
console.log(deleted);
}).catch((error) => {
console.log('An error has been occurred!', error);
})
try {
const deleted = await app.profiles.delete("1234");
console.log(deleted);
} catch (error) {
console.log('An error has been occurred!', error);
}
true
.enable(customId)
Enable a player profile (in case you disabled it).
More details and API reference: Enable profile
| Key | Type | Description |
|---|---|---|
customId | string unique required | Unique identifier from your services (1-64 characters) |
Promise<void>
app.profiles.enable("1234").then(() => {
console.log("event sent");
}).catch((error) => {
console.log('An error has been occurred!', error);
})
try {
await app.profiles.enable("1234");
} catch (error) {
console.log('An error has been occurred!', error);
}
No result
.disable(customId)
Disable a player profile to avoid the player to use his iPear profile (for example: your player doesn't have mobile phone prop in his inventory).
More details and API reference: Disable profile
| Key | Type | Description |
|---|---|---|
customId | string unique required | Unique identifier from your services (1-64 characters) |
Promise<void>
app.profiles.disable("1234").then(() => {
console.log("event sent");
}).catch((error) => {
console.log('An error has been occurred!', error);
})
try {
await app.profiles.disable("1234");
} catch (error) {
console.log('An error has been occurred!', error);
}
No result
Powered by Doctave