Deployment
This section explains how to deploy your own instance of the Sniff API service.
Cloudflare Workers
Sniff is designed to be deployed as a Cloudflare Worker, providing global distribution and low-latency access to the API.
Prerequisites
- Cloudflare account
- Wrangler CLI installed (npm install -g wrangler)
Environment Variables
The following environment variables are required for operation:
| Variable Name | Description | 
|---|---|
| DEVICE_NAME | Device identifier for Google Play API | 
| STABLE_EMAIL | Email for stable track access | 
| STABLE_AAS_TOKEN | Authentication token for stable track | 
| BETA_EMAIL | Email enrolled in beta programs | 
| BETA_AAS_TOKEN | Authentication token for beta access | 
| ALPHA_EMAIL | Email enrolled in alpha programs | 
| ALPHA_AAS_TOKEN | Authentication token for alpha access | 
Deployment Steps
- Clone the repository
- Configure environment variables in wrangler.tomlor through the Cloudflare dashboard
- Deploy using Wrangler:
wrangler publish
Authentication Tokens
To obtain the required AAS tokens for different channels, you can use the included OAuth2AAS tool:
Using OAuth2AAS Token Generator
- 
Get an OAuth2 token: - Open Google’s embedded setup page in your browser
- Log in with your Google account (use different accounts for stable/beta/alpha if needed)
- Access browser developer tools (F12 or right-click -> Inspect)
- Go to the “Application” tab, then “Local Storage”
- Copy the oauth2 token value
 
- 
Run the OAuth2AAS tool: cargo run --package oauth2aas <[email protected]m> <oauth2-token>
- 
Save the generated token: - Store the resulting AAS token as the appropriate environment variable
 
Ensure each email account is enrolled in the appropriate program (beta/alpha) for the respective channels. You’ll need to generate separate tokens for each channel you want to support.
OAuth2AAS Tool
The OAuth2AAS tool is included in the Sniff repository and provides a simple way to convert OAuth2 tokens to AAS tokens required by the Google Play API.