testnet-onboarding-api/README.md
prathamesh0 e7abf8d5eb
Implement an API for generating access token using sumsub (#1)
* Setup a Nodejs project with Typescript

* Implement an API for generating access token using sumsub

* Add cors

* Add usage to instructions

* Pass kyc level and ttl in .env

* Add a Dockerfile

---------

Co-authored-by: Adw8 <adwaitgharpure@gmail.com>
2024-07-26 16:50:20 +05:30

794 B

testnet-onboarding-api

  • Install dependencies and build:

    yarn && yarn build
    
  • Configure required tokens:

    cp .env.example .env
    
    # Set the sumsub app token and secret key in .env
    
  • Start the server:

    yarn start
    
  • Usage:

    curl -X POST http://localhost:3000/generate-token \
      -H "Content-Type: application/json" \
      -d '{"userId": "<user-id>", "levelName": "[kyc-level]", "ttlInSecs": "[token-ttl-in-secs]"}'
    
    # Optional:
    # levelName (default: basic-kyc-level)
    # ttlInSecs (default: 600)
    
  • Example:

    curl -X POST http://localhost:3000/generate-token \
      -H "Content-Type: application/json" \
      -d '{"userId": "JamesBond007"}'
    
    # Expected output:
    # {"token":"<generated-token>"}