Skip to main content

@Achievo/deployer-react

Description

API Client

Deployer React

This package provides a React hook and provider that allows developers to interact with the Achievo API directly from their React applications.

API Reference

For detailed information on the Achievo API and available methods, refer to the Achievo API documentation.

Requirements

  1. NodeJs >=18

Installation

To install the API client package, you can use npm: This package is the client for the Achievo API written in vanilla JavaScript.

npm install @achievo/deployer-react

Quickstart

Setup Provider

import { AchievoProvider } from "@achievo/deployer-react";

const TENANT_ID = "...";

export default function Page() {
return (
<AchievoProvider tenantId={TENANT_ID}>
<App />
</AchievoProvider>
);
}

Use Achievo Hook

import { useAchievo } from "@achievo/deployer-react";

const App = () => {
const {
achievoLoginWithSignature,
achievoSignature,
isLoggingIn,
achievoJWT,
} = useAchievo();

return (
<div className="w-screen min-h-screen text-black">
// ... your component
</div>
);
};

export default Deployer;

NOTE: you are required to authenticate to the Achievo API using the achievoLoginWithSignature() method before using the API.