Onramp web and mobile demo apps
Enable users to easily fund their crypto wallet. Get started with a basic API integration of Onramp for web and mobile apps.
Introduction
The Coinbase Onramp demo app will get you up and running with a basic API integration for web or mobile.
Onramp initialization
Coinbase Onramp can be initialized two ways: via URL (non-secure) or via API (secure). In the URL method, all initialization parameters are passed as query string parameters. In the API method, the destination wallet address is passed via an API call which returns a one-time-use session token. The session token is then combined with the rest of the initialization parameters to generate an Onramp URL. See docs for more details.
Onramp APIs
Coinbase Onramp has several APIs that can be called from a backend server to support different types of integrations. The use cases they support include:
- Creating session tokens
- Generating quotes for onramp aggregation
- Retrieving supported assets and payment methods in a given country
Note: an API integration is not required to use Onramp. The quickest way to use onramp is to pass all initialization parameters via query string parameter.
API keys
All of the Onramp APIs require a JWT bearer token. To generate JWTs you’ll need to create an API key which can be created in the CDP portal. You can find example code to generate JWTs here.
Web demo app
The demo app repo includes a simple demo app which calls the session tokens API to generate an Onramp URL (i.e. the secure initialization method). To get started, connect your wallet, select your onramping options and click Buy now.
How to run the web app
Follow the instructions documented in the repo and browse at localhost:3000
Mobile demo app
The Mobile demo app repo includes a simple demo app which uses the OnchainKit utils to fetch assets, networks, currencies in a simple UI. To get started, sign in using your social provider and start using Onramp.
How to run the mobile app
Dev environment:
Follow the instructions documented in the mobile demo app repo
Mobile (iOS):
Download the Onramp demo app from TestFlight.