Appearance
Login
Original login endpoints: email/password, Google and Apple sign-in, and session resume.
Endpoints
| Endpoint | Arguments | Returns |
|---|---|---|
login | email: string, password: string | string |
loginApple | idToken: string | string |
loginGoogle | idToken: string | string |
resume | session_id: string | string |
login
Description
Returns sessionId which, can be used as header hlrkey: <sessionId> or as cookie hlrkey: <sessionId>, or to connect a socket.io connection using the resume command
Parameters
Argument 1 (string, required): username
Argument 2 (string, required): password
Argument 3 (boolean, optional):
Example
javascript
const { Client } = require('@hailer/cli');
const client = await Client.create({
host: 'https://api.hailer.com',
username: 'you@example.com',
password: '••••••',
});
const result = await client.request('login', [
'string', // username (required)
'string', // password (required)
false, // argument 3
]);
console.log(result);Returns
string
Auth: callable without authentication.
Errors: on failure returns the standard Hailer error object { code, msg, details?, debug? }.
loginApple
Description
Login with Apple SSO. Returns sessionId which, can be used as header hlrkey: <sessionId> or as cookie hlrkey: <sessionId>, or to connect a socket.io connection using the resume command
Parameters
Argument 1 (string, required): idToken
Example
javascript
const { Client } = require('@hailer/cli');
const client = await Client.create({
host: 'https://api.hailer.com',
username: 'you@example.com',
password: '••••••',
});
const result = await client.request('loginApple', [
'string', // idToken (required)
]);
console.log(result);Returns
string
Auth: callable without authentication.
Errors: on failure returns the standard Hailer error object { code, msg, details?, debug? }.
loginGoogle
Description
Login with Google SSO. Returns sessionId which, can be used as header hlrkey: <sessionId> or as cookie hlrkey: <sessionId>, or to connect a socket.io connection using the resume command
Parameters
Argument 1 (string, required): idToken
Example
javascript
const { Client } = require('@hailer/cli');
const client = await Client.create({
host: 'https://api.hailer.com',
username: 'you@example.com',
password: '••••••',
});
const result = await client.request('loginGoogle', [
'string', // idToken (required)
]);
console.log(result);Returns
string
Auth: callable without authentication.
Errors: on failure returns the standard Hailer error object { code, msg, details?, debug? }.
resume
Description
Resume session - Used for resuming session with socket connection.
Parameters
Argument 1 (string, required):
Example
javascript
const { Client } = require('@hailer/cli');
const client = await Client.create({
host: 'https://api.hailer.com',
username: 'you@example.com',
password: '••••••',
});
const result = await client.request('resume', [
'string', // argument 1 (required)
]);
console.log(result);Returns
string
Auth: callable without authentication.
Errors: on failure returns the standard Hailer error object { code, msg, details?, debug? }.