apimatic-logalty-sdk
v0.0.1
Published
This is a sample SDK generated by APIMatic
Readme
Getting Started with Logalty Certificate Issuance API (Certy)
Introduction
API for certificate issuance through Logalty's "Certy" service.
Authentication
This API uses OAuth2 client credentials flow. A pair of keys (client_id / client_secret)
per environment must be requested from the Logalty integration team at [email protected].
Flow overview
- Authenticate against the OAuth2 server to obtain a Bearer token.
- Create a certificate issuance transaction.
- Query the transaction status.
- Download evidences (images, video, OCR) when available.
- Perform operations (resend access, cancel) if needed.
- Receive event notifications via the Feedback webhook.
Install the Package
Run the following command from your project directory to install the package from npm:
npm install [email protected]For additional package details, see the Npm page for the [email protected] npm.
Initialize the API Client
Note: Documentation for the client can be found here.
The following parameters are configurable for the API Client:
| Parameter | Type | Description |
| --- | --- | --- |
| certyServer | string | Hostname of the Certy API serverDefault: 'certy_server' |
| oauth2Server | string | Hostname of the OAuth2 serverDefault: 'oauth2_server' |
| environment | Environment | The API environment. Default: Environment.Production |
| timeout | number | Timeout for API calls.Default: 30000 |
| httpClientOptions | Partial<HttpClientOptions> | Stable configurable http client options. |
| unstableHttpClientOptions | any | Unstable configurable http client options. |
| logging | PartialLoggingOptions | Logging Configuration to enable logging |
| bearerAuthCredentials | BearerAuthCredentials | The credential object for bearerAuth |
| basicAuthCredentials | BasicAuthCredentials | The credential object for basicAuth |
The API client can be initialized as follows:
Code-Based Client Initialization
import { Client, Environment, LogLevel } from 'apimatic-logalty-sdk';
const client = new Client({
bearerAuthCredentials: {
accessToken: 'AccessToken'
},
basicAuthCredentials: {
username: 'Username',
password: 'Password'
},
timeout: 30000,
environment: Environment.Production,
logging: {
logLevel: LogLevel.Info,
logRequest: {
logBody: true
},
logResponse: {
logHeaders: true
}
},
certyServer: 'certy_server',
oauth2Server: 'oauth2_server',
});Configuration-Based Client Initialization
import * as path from 'path';
import * as fs from 'fs';
import { Client } from 'apimatic-logalty-sdk';
// Provide absolute path for the configuration file
const absolutePath = path.resolve('./config.json');
// Read the configuration file content
const fileContent = fs.readFileSync(absolutePath, 'utf-8');
// Initialize client from JSON configuration content
const client = Client.fromJsonConfig(fileContent);See the Configuration-Based Client Initialization section for details.
Environment-Based Client Initialization
import * as dotenv from 'dotenv';
import * as path from 'path';
import * as fs from 'fs';
import { Client } from 'apimatic-logalty-sdk';
// Optional - Provide absolute path for the .env file
const absolutePath = path.resolve('./.env');
if (fs.existsSync(absolutePath)) {
// Load environment variables from .env file
dotenv.config({ path: absolutePath, override: true });
}
// Initialize client using environment variables
const client = Client.fromEnvironment(process.env);See the Environment-Based Client Initialization section for details.
Environments
The SDK can be configured to use a different environment for making API calls. Available environments are:
Fields
| Name | Description | | --- | --- | | Production | Default Certy API server | | Environment2 | OAuth2 authentication server |
Authorization
This API uses the following authentication schemes.
List of APIs
SDK Infrastructure
Configuration
- HttpClientOptions
- RetryConfiguration
- ProxySettings
- Configuration-Based Client Initialization
- Environment-Based Client Initialization
- PartialLoggingOptions
- PartialRequestLoggingOptions
- PartialResponseLoggingOptions
- LoggerInterface
