Configuration

View Source

Required keys

KeyDescription
project_idYour Appwrite project ID
secretYour Appwrite API key
root_uriAppwrite endpoint (default: https://cloud.appwrite.io/v1)

Compile-time config

Add to config/config.exs:

config :appwrite,
  project_id: System.get_env("APPWRITE_PROJECT_ID"),
  secret:     System.get_env("APPWRITE_SECRET"),
  root_uri:   System.get_env("APPWRITE_ENDPOINT", "https://cloud.appwrite.io/v1")

In config/runtime.exs:

import Config

if config_env() == :prod do
  config :appwrite,
    project_id: System.fetch_env!("APPWRITE_PROJECT_ID"),
    secret:     System.fetch_env!("APPWRITE_SECRET"),
    root_uri:   System.get_env("APPWRITE_ENDPOINT", "https://cloud.appwrite.io/v1")
end

Test config

In config/test.exs:

import Config

config :appwrite,
  project_id: System.get_env("APPWRITE_TEST_PROJECT_ID", "test-project"),
  secret:     System.get_env("APPWRITE_TEST_SECRET", "test-secret"),
  root_uri:   System.get_env("APPWRITE_TEST_ENDPOINT", "https://cloud.appwrite.io/v1")

Self-hosted Appwrite

Set root_uri to your own endpoint:

config :appwrite,
  root_uri: "https://appwrite.mycompany.com/v1"