Try our SDK Examples
Our SDK examples use the latest SDK version and are a great source to learn about implementation
Our SDK examples can be found in Tweed's public GitHub directory:
There are several ways to experiment with Tweed's SDK:
NextJS
This is an example of a full NextJS project (frontend and backend) that shows how to use the SDK using an SSR platform.
Run the frontend:
git clone https://github.com/paytweed/nextjs-sdk-example.git
npm install
npm start
The frontend will run at http://localhost:3000
NodeJS + React
NodeJS
This is the backend part of the example: it mimics the platform backend and implements the backend part of the SDK. The backend of the platform holds the user information and API key to communicate with Tweed's backend.
React
This is the frontend part of the example: it mimics the platform frontend / app and implements the frontend part of the SDK. The frontend of the platform is what interacts with the user and their device. It communicates to the backend SDK using the message bus.
Step 1: Insert your API Key
Step 2: Run the backend
Step 3: Check the output
Step 4: Run the frontend
Step 1: Insert your API key
You can get your API keys here.
Edit the file: index.js and insert your API key, API secret, environment, and the blockchain IDs you wish to test here:
apiKey: 'YOUR_API_KEY'
apiSecret: 'YOUR_API_SECRET'
environment: Environment.demo
defaultBlockchainIds: ["tezosGhost", "polygonMumbai", "ethereumSepolia"],
Step 2: Run the backend
git clone https://github.com/paytweed/backend-sdk-nodejs-example.git
npm install
npm start
Step 3: Check the output
Confirm that you receive the following output.
> backend-sdk-nodejs-example@0.0.1 start
> node src/index.js
App is listening on port 3010
The backend will run and use port 3010
as its communication channel to get messages from the frontend.
Step 4: Run the frontend
git clone https://github.com/paytweed/frontend-sdk-react-example.git
npm install
npm start
The frontend will run at http://localhost:3000
NodeJS + VueJS
NodeJS
This is the backend part of the example: it mimics the platform backend and implements the backend part of the SDK. The backend of the platform holds the user information and API key to communicate with Tweed's backend.
VueJS
This frontend was written in a Vue.JS using the vanilla JS SDK.
Step 1: Insert your API Key
Step 2: Run the backend
Step 3: Check the output
Step 4: Run the frontend
Step 1: Insert your API key
You can get your API keys here.
Edit the file: index.js and insert your API key, API secret, environment, and the blockchain IDs you wish to test here:
apiKey: 'YOUR_API_KEY'
apiSecret: 'YOUR_API_SECRET'
environment: Environment.demo
defaultBlockchainIds: ["tezosGhost", "polygonMumbai", "ethereumSepolia"],
Step 2: Run the backend
git clone https://github.com/paytweed/backend-sdk-nodejs-example.git
npm install
npm start
Step 3: Check the output
Confirm that you receive the following output.
> backend-sdk-nodejs-example@0.0.1 start
> node src/index.js
App is listening on port 3010
The backend will run and use port 3010
as its communication channel to get messages from the frontend.
Step 4: Run the frontend
git clone https://github.com/paytweed/frontend-sdk-vue-example.git
npm install
npm start
The frontend will run at http://localhost:3000
React Native
NodeJS
This is the backend part of the example: it mimics the platform backend and implements the backend part of the SDK. The backend of the platform holds the user information and API key to communicate with Tweed's backend.
React Native
This mobile frontend was written in the ReactNative framework.
Last updated