This repository contains scripts in several languages to get started with the Events API.
All scripts use the EVENTS_API_TOKEN environment variable to load your API token. You should use op run and secret references provided by the 1Password CLI to securely load environment variables.
Use of the 1Password APIs and services accessed through this project is governed by the 1Password API Terms of Service.
Example 1 - using an .env file, running the PHP script:
op run --env-file .env -- php eventsapi.phpExample 2 - providing variables inline, running the Go script:
EVENTS_API_TOKEN="op://Vault/Item/token" op run -- go run eventsapi.goYou can generate an API bearer token on 1Password.com or with the CLI.
The script will print up to 20 audit events, sign-in attempts, or item usages from the last 24 hours.
Learn more about how to get started with 1Password Events Reporting.