Skip to content

Instantly share code, notes, and snippets.

@sandalsoft
Created August 15, 2025 13:58
Show Gist options
  • Select an option

  • Save sandalsoft/d41d9cb99e45eb366e4a3d32f8676293 to your computer and use it in GitHub Desktop.

Select an option

Save sandalsoft/d41d9cb99e45eb366e4a3d32f8676293 to your computer and use it in GitHub Desktop.
# Check required environment variables
if [ -z "$PROMPTQL_ACCESS_TOKEN" ]; then
echo "Error: PROMPTQL_ACCESS_TOKEN environment variable is not set or empty. Use a project service account token or Personal Access Token (PAT)" >&2
exit 1
fi
if [ -z "$PROMPTQL_PROJECT_ID" ]; then
echo "Error: PROMPTQL_PROJECT_ID environment variable is not set or empty" >&2
exit 1
fi
curl -s -X POST "${PROMPTQL_TOKEN_REFRESH_URL:-https://auth.pro.hasura.io/ddn/promptql/token}" \
-H "Authorization: pat $PROMPTQL_ACCESS_TOKEN" \
-H "x-hasura-project-id: $PROMPTQL_PROJECT_ID" \
-H "Content-Type: application/json" \
| jq -r '.token'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment