Skip to main content
Version: 3.1.4

React

Initialize an empty React project

# yarn
yarn create react-app <project-name> --template typescript

# npx
npx create-react-app <project-name> --template typescript

Add Integry SDK

# yarn
yarn add @integry/sdk

# npm
npm i @integry/sdk -S

Add SDK code

src/App.tsx
function App() {
useEffect(() => {
const init = async () => {
// Fill these in from the SDK deployment page
const appKey = '<APP_KEY>';
const appSecret = '<APP_SECRET>';
const userId = '<USER_ID>';
const deploymentId = '<DEPLOY_ID>';

// This is intended for use in testing only!
// Please refer to sdk.integry.io for more details
const hash = await Helpers.getAuthHash(userId, appSecret);

const integryHandle = new IntegryJS({
appKey,
hash,
userId,
deploymentId,
});

integryHandle.init({
containerId: 'my-sdk-container',
renderMode: IntegryJS.RenderModes.INLINE,
});
};
init();
}, []);

return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
</header>
<div className="App-embed" id="my-sdk-container" />
</div>
);
}
tip

A full example is hosted here on Github.