coronado
v0.0.19
Published
triple API Typescript/JavaScript wrapper
Downloads
22
Readme
Coronado TypeScript
coronado - Native language wrapper for the triple API. The triple API enables partners to integrate with the triple platform. The full API documentation is available from https://api.tripleup.dev/docs
Typescript/JavaScript API:
- https://coronado-fi.github.io/coronado-js
Python API reference implementation:
- https://coronado-fi.github.io/coronado
JVM API:
- https://coronado-fi.github.io/coronado-jvm/
Description
Reference implementation wrapper for the triple API. All wrappers are implemented under the umbrella project Coronado, can can be viewed on-line at:
- https://github.com/coronado-fi
- https://coronado.fi - under construction
Use of this API requires credentials issued by tripleup.com and access to an S3 bucket provided by them. Contact tripleup.com to assist you in setting up access.
Installation
The coronado package is available on npm. Use the corresponding best-practice mechanism to install.
TypeScript/JavaScript
Install using npm
npm install coronado
Install using yarn
yarn add coronado
Authentication
This component requires OAuth2 credentials available from triple - please contact a triple representative to get this information. Credentials cover:
- clientID
- clientName
- secret
- serviceURL - different URLs for sandbox, staging, production
- tokenURL - the OAuth2 service provider
Creating a Client object with a given scope allows you to access any of the
subsequent API wrappers below. It is assumed that the .env
will be
stored in the proper location given your operating system.
CORONADO_CLIENT_ID=
CORONADO_CLIENT_NAME=
CORONADO_SECRET=
CORONADO_SERVICE_URL=
CORONADO_TOKEN_URL=
First thing to do is initialize a Client with a given scope. It will throw an exception should the config not exist and/or auth fail.
const client = await Client.createClient(Scope.PUBLISHERS)
API wrappers usage
This example leverages the Publisher object and service, but the concepts shown
here apply to all the Coronado API business objects. We use the async/await syntax
for brevity but all of these methods return a Promise
which can be used as expected.
# Return a Coronado client object for given entity
const publisher = await client.publisher()
const publisherList = await publisher.list()
const publisherEntity = await publisher.byId(42)
assert publisherList][3].assumedName === publisherEntity.assumedName
print(publisherEntity.address)
Implemented Wrappers
The following is a list of the wrappers we currently implement from the core numo library.
To be implemented:
- Transactions
- Offer Activation
- Offer Display
- Offer Display Rules (not ready yet)
- Offer Providers
- Merchants
- Offers (not implemented yet)
- Affiliate Links
Command Line
The library also contains a command line interface which exposes most of the functionality through command names and flags and exercises the wrappers.
Here we're assuming yarn
but npm
should work just the same.
To run the health check and return the JSON response execute from the root of project:
yarn cli health
API reference
Under construction
The API references for all supported languages are available from:
https://coronado.fi/docs
BUGS
See GitHub issues: https://github.com/coronado-fi/coronado-js/issues
AUTHOR
numo LLC and triple LLC, <coronado.project AT numo.com>
SEE ALSO
- https://api.tripleup.dev/docs