2.1.19 • Published 2 years ago
@pagali/client v2.1.19
@pagali/client
Package containing SDKs to simplify requests to Pagali API
Usage:
/* Your Api Key and API Url */
const clientConfig = {
accessToken: '<your_api_key>',
url: '<api_url>',
};
const client = new PagaliClient(clientConfig);
const merchants = await client.management.merchants.get({}, { params: { 'page[number]': 1, 'page[size]': 5 } });
The client also comes with a configurable cache layer that uses Redis to store responses from GET requests. See the example below to configure and use it:
/* Your Api Key and API Url */
const clientConfig = {
accessToken: '<your_api_key>',
url: '<api_url>',
};
/* Your Redis Config */
const cacheConfig = {
host: '<your_redis_host>',
port: '<your_redis_port>',
db: '<your_redis_db_number>',
password: '<your_redis_password>',
keyPrefix: '<your_custom_key_prefix>',
};
const client = new PagaliClient(clientConfig, cacheConfig);
/* Specify the ttl value (in seconds) to make use of redis for storing/retrieving the result */
const merchants = await client.management.merchants.get({}, { params: { 'page[number]': 1, 'page[size]': 5 } });
const firstMerchantId = merchants[0].id;
const merchant = await client.management.merchants.getOne(firstMerchantId, {}, { cacheTtlSeconds: 60 });
/* Close the underlying redis connection */
client.shutdown();
2.1.18
2 years ago
2.1.19
2 years ago
2.1.2
2 years ago
2.1.1
2 years ago
2.1.4
2 years ago
2.1.5
2 years ago
2.1.8
2 years ago
2.1.7
2 years ago
2.1.9
2 years ago
2.1.17
2 years ago
2.1.14
2 years ago
2.1.15
2 years ago
2.1.12
2 years ago
2.1.13
2 years ago
2.1.11
2 years ago
2.1.13-dev1.0
2 years ago
2.1.0
2 years ago
2.0.19
2 years ago
2.0.18
2 years ago
2.0.20
2 years ago
2.0.21
2 years ago
2.0.17
2 years ago
2.0.16
2 years ago
2.0.15
2 years ago
2.0.14
2 years ago
2.0.13
2 years ago
2.0.11
2 years ago
2.0.10
2 years ago
2.0.9
2 years ago
2.0.8
2 years ago
2.0.7
2 years ago
2.0.6
2 years ago
2.0.5
2 years ago
2.0.4
2 years ago
2.0.3
2 years ago
2.0.2
2 years ago
2.0.1
2 years ago
2.0.0
2 years ago
1.0.1
2 years ago
1.0.0
2 years ago