Getting Started
This is the first section of a step-by-step guide to start using Griptape.js in your application.
Installation and setup
Griptape.js is able to work along any front-end UI library out there. Therefore, the first step is to set up an application in which then you can install Griptape.js. Example of libraries are:
Once you have a front-end application ready, install Griptape.js by running one of the following:
# Using yarn
yarn add @stakeordie/griptape.js
# or npm
npm install @stakeordie/griptape.js
2
3
4
5
Gripping an app
A gripped application is a term we use to describe an application which bootstrap process is handled by Griptape. Grip your app by adding this to your main.js or index.js file:
import {
gripApp,
getKeplrAccountProvider
} from '@stakeordie/griptape.js';
const restUrl = 'https://api.stakeordie.com';
const provider = getKeplrAccountProvider();
function runApp() {
// Bootstrap your app here!
}
gripApp(restUrl, provider, runApp);
2
3
4
5
6
7
8
9
10
11
12
runApp is a function able to bootstrap your front-end application, e.g. for Vue.js the implementation looks like this:
function runApp() {
createApp(App).mount('#app');
}
2
3
Or in React, like this:
function runApp() {
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
);
}
2
3
4
5
6
7
8
Now you are ready! You can start developing your Dapp.