Integration

Use our API to integrate seamlessly with your platform

Follow the steps below to get started with integrating our API into your platform. You'll be able to access all the features you need to enhance your service.

Integration Code

Get Your API Key

React Integration

import { useEffect, useState } from "react";
import { initializeTetrons, isApiKeyValid, EditorContent } from "tetrons";
import "tetrons/style.css";

function App() {
  const apiKey = "your_api_key";

  const [loading, setLoading] = useState(true);
  const [isValid, setIsValid] = useState(false);
  const [error, setError] = useState("");

  useEffect(() => {
    async function validate() {
      try {
        await initializeTetrons(apiKey);
        setIsValid(isApiKeyValid());
      } catch (err) {
        setError(err.message);
      } finally {
        setLoading(false);
      }
    }
    validate();
  }, [apiKey]);

  if (loading) return <div>🔍 Validating API key...</div>;
  if (!isValid) return <div style={{ color: "red" }}>API Key Invalid: {error}</div>;

  return (
    <div style={{ padding: "2rem" }}>
      <EditorContent apiKey={apiKey} />
    </div>
  );
}

export default App;

Your API Key

Use this key to authenticate your API requests

Keep your API key secure and never expose it in client-side code

Chatbot