Table of Contents:
If not by the docs, we have a video to walk you through the installation and setting up sonic in your dapp.
npm install @0xsonic/sdk
yarn add @0xsonic/sdk
pnpm install @0xsonic/sdk
React-js Application:
Warning Currently we're facing a source map issue which will throw some weird warnings in your react-app, for this we have a temporary solution to be added in package.json file.
Add GENERATE_SOURCEMAP=true
in front of react-scripts start
so the warning goes off!
// package.json
"scripts": {
"start": "GENERATE_SOURCEMAP=false react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
},
// src/index.js
import React from 'react';
import ReactDOM from 'react-dom/client';
import App from './App';
import { SonicProvider } from '@0xsonic/sdk';
// ...
root.render(
<React.StrictMode>
<SonicProvider> // wrap around your react app component
<App />
</SonicProvider>
</React.StrictMode>
);
// src/App.js
import React from 'react';
import { Sonic } from '@0xsonic/sdk';
function App() {
return (
<>
<Blog/>
<Sonic context="blog-related-context"/> // enables decentralised comments for your dapp
</>
);
}
export default App;
<SonicProvider />
SonicProvider wrapper helps us to manage the states and connection with Orbis & Ceramic protocol under the hood.<Sonic context=""/>
Sonic is the main plug-&-play comments widget that dApps can use to integrate decentralised comments feature with 0 headache.<SonicForum />
WIP ๐ A easy to use forums widget for all Web3ians<SonicChat />
WIP ๐ Another quick, plug-&-play chat widget for dApps, dGames
Framework | Version |
---|---|
react-js | 0.2.6 โ |
next-js | 0.3.0 ๐ |
react-ts | 0.3.5 ๐ |
next-ts | 0.4.0 ๐ |
vue | 0.5.0 ๐ |
svelte | 0.6.0 ๐ |
We plan to release these major versions and support all the leading web frameworks in coming months.
All code contributions, including those of people having commit access, must go through a pull request and be approved by a core developer before being merged. This is to ensure a proper review of all the code.
We truly โค๏ธ pull requests! If you wish to help, we will soon be making our sdk ready to be contribute post hackathon, and we'll do a proper announcement for everyone to contribute.
This repository is available under the MIT License.