Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
celitech-sdk
Advanced tools
Celitech - Welcome to the CELITECH API documentation! Useful links: [Homepage](https://www.celitech.com) | [Support email](mailto:support@celitech.com) | [Blog](https://www.celitech.com/blog/)
The Typescript SDK for Celitech.
Welcome to the CELITECH API documentation! Useful links: Homepage | Support email | Blog
npm install celitech-sdk
You will need the following environment variables in order to access all the features of this SDK:
Name | Description |
---|---|
CLIENT_ID | Client ID parameter |
CLIENT_SECRET | Client Secret parameter |
You can set these environment variables on the command line or you can use
whatever tooling your project has in place to manage environment variables. If
you are using a .env
file, we have provided a template with the variable names
in the .env.example
file in the same directory as this readme.
Here is a simple program demonstrating usage of this SDK. It can also be found in the examples/src/index.ts
file in this directory.
When running the sample make sure to use npm install
to install all the dependencies.
import { Celitech } from 'celitech-sdk';
const sdk = new Celitech();
(async () => {
try {
const result = await sdk.destinations
.listDestinations();
console.log(result);
} catch (err) {
const error = err as Error;
console.error(error.message);
}
})();
A list of all services and services methods.
Services
Method | Description |
---|---|
listDestinations | List Destinations |
Method | Description |
---|---|
listPackages | List Packages |
Method | Description |
---|---|
createPurchase | Create Purchase |
listPurchases | List Purchases |
topUpEsim | Top-up eSIM |
editPurchase | Edit Purchase |
getPurchaseConsumption | Get Purchase Consumption |
Method | Description |
---|---|
getEsim | Get eSIM Status |
getEsimDevice | Get eSIM Device |
getEsimHistory | Get eSIM History |
getEsimMac | Get eSIM MAC |
List Destinations
Return Type
ListDestinationsResponse
Example Usage Code Snippet
import { Celitech } from 'celitech-sdk';
const sdk = new Celitech();
(async () => {
const result = await sdk.destinations.listDestinations();
console.log(result);
})();
List Packages
Optional Parameters
Optional parameters are passed as part of the last parameter to the method. Ex. {optionalParam1 : 'value1', optionalParam2: 'value2'}
Name | Type | Description |
---|---|---|
destination | string | ISO representation of the package's destination. |
startDate | string | Start date of the package's validity in the format 'yyyy-MM-dd'. This date can be set to the current day or any day within the next 12 months. |
endDate | string | End date of the package's validity in the format 'yyyy-MM-dd'. End date can be maximum 60 days after Start date. |
afterCursor | string | To get the next batch of results, use this parameter. It tells the API where to start fetching data after the last item you received. It helps you avoid repeats and efficiently browse through large sets of data. |
limit | number | Maximum number of packages to be returned in the response. The value must be greater than 0 and less than or equal to 160. If not provided, the default value is 20 |
startTime | number | Epoch value representing the start time of the package's validity. This timestamp can be set to the current time or any time within the next 12 months |
endTime | number | Epoch value representing the end time of the package's validity. End time can be maximum 60 days after Start time |
duration | number | Duration in seconds for the package's validity. If this parameter is present, it will override the startTime and endTime parameters. The maximum duration for a package's validity period is 60 days |
Return Type
ListPackagesResponse
Example Usage Code Snippet
import { Celitech } from 'celitech-sdk';
const sdk = new Celitech();
(async () => {
const result = await sdk.packages.listPackages();
console.log(result);
})();
Create Purchase
Required Parameters
| input | object | Request body. |
Return Type
CreatePurchaseResponse
Example Usage Code Snippet
import { Celitech } from 'celitech-sdk';
const sdk = new Celitech();
(async () => {
const input = {
dataLimitInGB: 1,
destination: 'FRA',
endDate: '2023-11-20',
startDate: '2023-11-01',
};
const result = await sdk.purchases.createPurchase(input);
console.log(result);
})();
List Purchases
Optional Parameters
Optional parameters are passed as part of the last parameter to the method. Ex. {optionalParam1 : 'value1', optionalParam2: 'value2'}
Name | Type | Description |
---|---|---|
iccid | string | ID of the eSIM |
afterDate | string | Start date of the interval for filtering purchases in the format 'yyyy-MM-dd' |
beforeDate | string | End date of the interval for filtering purchases in the format 'yyyy-MM-dd' |
afterCursor | string | To get the next batch of results, use this parameter. It tells the API where to start fetching data after the last item you received. It helps you avoid repeats and efficiently browse through large sets of data. |
limit | number | Maximum number of purchases to be returned in the response. The value must be greater than 0 and less than or equal to 100. If not provided, the default value is 20 |
after | number | Epoch value representing the start of the time interval for filtering purchases |
before | number | Epoch value representing the end of the time interval for filtering purchases |
Return Type
ListPurchasesResponse
Example Usage Code Snippet
import { Celitech } from 'celitech-sdk';
const sdk = new Celitech();
(async () => {
const result = await sdk.purchases.listPurchases();
console.log(result);
})();
Top-up eSIM
Required Parameters
| input | object | Request body. |
Return Type
TopUpEsimResponse
Example Usage Code Snippet
import { Celitech } from 'celitech-sdk';
const sdk = new Celitech();
(async () => {
const input = {
dataLimitInGB: 1,
endDate: '2023-11-20',
iccid: '1111222233334444555',
startDate: '2023-11-01',
};
const result = await sdk.purchases.topUpEsim(input);
console.log(result);
})();
Edit Purchase
Required Parameters
| input | object | Request body. |
Return Type
EditPurchaseResponse
Example Usage Code Snippet
import { Celitech } from 'celitech-sdk';
const sdk = new Celitech();
(async () => {
const input = {
endDate: '2023-11-20',
purchaseId: 'ae471106-c8b4-42cf-b83a-b061291f2922',
startDate: '2023-11-01',
};
const result = await sdk.purchases.editPurchase(input);
console.log(result);
})();
Get Purchase Consumption
Required Parameters
Name | Type | Description |
---|---|---|
purchaseId | string | ID of the purchase |
Return Type
GetPurchaseConsumptionResponse
Example Usage Code Snippet
import { Celitech } from 'celitech-sdk';
const sdk = new Celitech();
(async () => {
const result = await sdk.purchases.getPurchaseConsumption('4973fa15-6979-4daa-9cf3-672620df819c');
console.log(result);
})();
Get eSIM Status
Required Parameters
Name | Type | Description |
---|---|---|
iccid | string | ID of the eSIM |
Return Type
GetEsimResponse
Example Usage Code Snippet
import { Celitech } from 'celitech-sdk';
const sdk = new Celitech();
(async () => {
const result = await sdk.eSim.getEsim('1111222233334444555');
console.log(result);
})();
Get eSIM Device
Required Parameters
Name | Type | Description |
---|---|---|
iccid | string | ID of the eSIM |
Return Type
GetEsimDeviceResponse
Example Usage Code Snippet
import { Celitech } from 'celitech-sdk';
const sdk = new Celitech();
(async () => {
const result = await sdk.eSim.getEsimDevice('1111222233334444555');
console.log(result);
})();
Get eSIM History
Required Parameters
Name | Type | Description |
---|---|---|
iccid | string | ID of the eSIM |
Return Type
GetEsimHistoryResponse
Example Usage Code Snippet
import { Celitech } from 'celitech-sdk';
const sdk = new Celitech();
(async () => {
const result = await sdk.eSim.getEsimHistory('1111222233334444555');
console.log(result);
})();
Get eSIM MAC
Required Parameters
Name | Type | Description |
---|---|---|
iccid | string | ID of the eSIM |
Return Type
GetEsimMacResponse
Example Usage Code Snippet
import { Celitech } from 'celitech-sdk';
const sdk = new Celitech();
(async () => {
const result = await sdk.eSim.getEsimMac('1111222233334444555');
console.log(result);
})();
License: MIT. See license in LICENSE.
FAQs
Welcome to the CELITECH API documentation! Useful links: [Homepage](https://www.celitech.com) | [Support email](mailto:support@celitech.com) | [Blog](https://www.celitech.com/blog/)
The npm package celitech-sdk receives a total of 48 weekly downloads. As such, celitech-sdk popularity was classified as not popular.
We found that celitech-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.