naystack - v1.9.9
    Preparing search index...

    Function addEnv

    • Sets a client-side endpoint at runtime, for environments with no NEXT_PUBLIC_* build step (React Native, Expo). Keys are the env names with the NEXT_PUBLIC_ prefix dropped; a real env var still wins when both exist.

      Parameters

      • key: string

        "GRAPHQL_ENDPOINT", "EMAIL_AUTH_ENDPOINT", "GOOGLE_AUTH_ENDPOINT", "SOCIAL_AUTH_ENDPOINT", "FILE_ENDPOINT" or "BASE_URL".

      • value: string

        The absolute URL.

      Returns void

      import { addEnv } from "naystack/env";

      addEnv("GRAPHQL_ENDPOINT", "https://yourapp.com/api/graphql");
      addEnv("EMAIL_AUTH_ENDPOINT", "https://yourapp.com/api/email");