Each example here drives the three-leg OAuth2 authorization-code flow end to end:
- Redirect the browser to
cryptohopper.com/oauth2/authorizewith yourclient_id. - User logs in and grants consent → browser redirected to your callback with a
code. - Exchange
codefor anaccess_tokenatcryptohopper.com/oauth2/token. - Use the token on
api.cryptohopper.com/v1/...calls.
| Language | Directory | Notes |
|---|---|---|
| Node.js | nodejs/ |
Express + Node 18+ stdlib fetch. Zero third-party HTTP/OAuth libs. |
| Python | python/ |
requests |
| PHP | php/ |
curl + Bootstrap form |
For a pure-curl walkthrough (any language), see ../quickstart/curl/.
The OAuth dance is the same regardless of language — every SDK keeps it as a one-time setup step you do outside the SDK. Once you have a token, the SDK handles everything from there.
The simplest end-to-end:
cryptohopper login # browser consent, token persisted to ~/.cryptohopper/config.json
cat ~/.cryptohopper/config.json # extract the token if you need it elsewhereThat's the cryptohopper-cli doing all of the steps in this directory for you. Use it during development; reach for these per-language samples when you're embedding the flow in your own server-side app.