Go to file
Prathamesh Musale f996d380e8 Add netcat installation in Dockerfile (#1)
Part of [Sumsub KYC integration in onboarding app](https://www.notion.so/Sumsub-KYC-integration-in-onboarding-app-607b598c9c1d4d12adc71725e2ab5e7e)

Reviewed-on: #1
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
2024-07-26 12:23:17 +00:00
src Implement an API for generating access token using sumsub (#1) 2024-07-26 16:50:20 +05:30
.env.example Implement an API for generating access token using sumsub (#1) 2024-07-26 16:50:20 +05:30
.gitignore Initial commit 2024-07-25 18:27:01 +05:30
Dockerfile Add netcat installation in Dockerfile (#1) 2024-07-26 12:23:17 +00:00
package.json Implement an API for generating access token using sumsub (#1) 2024-07-26 16:50:20 +05:30
README.md Implement an API for generating access token using sumsub (#1) 2024-07-26 16:50:20 +05:30
tsconfig.json Implement an API for generating access token using sumsub (#1) 2024-07-26 16:50:20 +05:30
yarn.lock Implement an API for generating access token using sumsub (#1) 2024-07-26 16:50:20 +05:30

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>"}