GateKit

BASE INTEGRATION

Turn Base token state into permissions.

Create ERC-20, ERC-721 or ERC-1155 access rules without moving authorization logic into your application code.

01

Keep chain logic behind one policy

Your application sends a wallet and policy ID. GateKit reads Base through its chain adapter, evaluates the saved policy and returns entitlements. Your app consumes the decision instead of rebuilding token ownership checks in every route.

02

Example: require at least 1 USDC on Base

Rule type: ERC-20 balance
Chain: Base
Contract: 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
Minimum raw units: 1000000
Entitlement: premium

The contract above is the Base USDC contract used in GateKit's Production chain verification. Replace it with the contract required by your own product.

03

ERC-20 minimums use raw smallest units

GateKit compares the integer returned by balanceOf. For a 6-decimal token, 1000000 raw units represents 1 whole token. Do not enter 1 when you intend to require 1 whole 6-decimal token.

ERC-721 and ERC-1155 minimums represent integer token balances instead.

04

Evaluate from a trusted server boundary

const result = await gatekit.verify({
  policyId: process.env.GATEKIT_POLICY_ID!,
  wallet: userWallet,
});

if (result.status === "error") {
  // Chain/provider verification unavailable.
  // Fail closed and return a temporary application error.
}

if (!result.allowed) {
  // Conclusive policy denial.
}

// Grant result.entitlements

Keep the GateKit API key in server-only environment variables. The browser may send the connected wallet to your own backend, but it should not receive the GateKit project key.

05

Denied and unavailable are different states

denied means the Base state was checked and the policy failed. error means GateKit could not make a trustworthy decision and returns HTTP 503. Treat that condition as temporary infrastructure failure and fail closed.

Open server SDK guide