The @cords/react
package provides a React component for integrating the CORDS widget into your application.
You can install the SDK using npm or any other package manager:
npm install @cords/react
To use the CordsWidget
component in your React application, you can follow the example provided in the React example package. Here's a brief overview of how to integrate it:
- Import the
CordsWidget
component from@cords/react
. - Use the component in your application, providing the necessary prop
apiKey
To receive an api key you must login and copy your key from https://partners.cords.dev
Warning: Your api key should be hidden from git using an environment variable
Example usage:
import { CordsWidget } from "@cords/react";
import React from "react";
function MyApp() {
const apiKey = "YOUR_API_KEY_HERE"; // Get your API key from https://partners.cords.dev
return (
<div>
<CordsWidget apiKey={apiKey} />
</div>
);
}
export default MyApp;
This example demonstrates how to embed a Cords widget into a React application. The CordsWidget
component takes care of rendering the widget and handling its interactions seamlessly within your app.