{"id":21994761,"url":"https://github.com/allow2/allow2automate-battle.net","last_synced_at":"2026-05-04T19:33:58.386Z","repository":{"id":57190064,"uuid":"235165842","full_name":"Allow2/allow2automate-battle.net","owner":"Allow2","description":"Enable Allow2Automate management of World of Warcraft parental controls","archived":false,"fork":false,"pushed_at":"2022-09-07T23:49:32.000Z","size":119,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-28T18:26:13.212Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Allow2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-20T18:09:46.000Z","updated_at":"2021-02-21T00:03:36.000Z","dependencies_parsed_at":"2022-09-16T04:51:11.634Z","dependency_job_id":null,"html_url":"https://github.com/Allow2/allow2automate-battle.net","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Allow2%2Fallow2automate-battle.net","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Allow2%2Fallow2automate-battle.net/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Allow2%2Fallow2automate-battle.net/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Allow2%2Fallow2automate-battle.net/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Allow2","download_url":"https://codeload.github.com/Allow2/allow2automate-battle.net/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245052660,"owners_count":20553172,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-29T21:10:23.050Z","updated_at":"2026-05-04T19:33:58.381Z","avatar_url":"https://github.com/Allow2.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Battle.net Parental Controls Plugin\n\nEnable Allow2Automate management of Battle.net parental controls to manage gaming time and access for your children.\n\n## Description\n\nThis plugin integrates Battle.net (Blizzard Entertainment) with Allow2 parental controls, enabling parents to automate Battle.net parental control schedules based on Allow2 quotas. Uses Playwright browser automation to interact with the Battle.net parent portal, providing seamless integration between Allow2 and Battle.net's existing parental control system.\n\n## Features\n\n- Automated Battle.net parental control schedule updates based on Allow2 quotas\n- Token-based authentication with Battle.net parent portal\n- Browser automation via Playwright (headless or visible)\n- Enable/disable gaming access for children\n- Custom schedule management per child\n- Support for multiple child profiles\n- Token validation and extraction from URLs\n- Secure session management\n\n## Installation\n\n### Via NPM\n\n```bash\nnpm install @allow2/allow2automate-battle.net\n```\n\n### Via Git\n\n```bash\ngit clone https://github.com/Allow2/allow2automate-battle.net.git\ncd allow2automate-battle.net\nnpm install\nnpm run build\n```\n\n## Configuration\n\n1. Install the plugin in your Allow2Automate application\n2. Obtain your Battle.net parent portal XSRF token:\n   - Navigate to https://account.blizzard.com/parent-portal\n   - Log in with parent account\n   - Copy the URL or XSRF token from the parental controls page\n3. Enter the token or URL in the plugin configuration\n4. Pair Battle.net children with Allow2 children\n5. Enable the plugin to start automated quota management\n\n### Required Permissions\n\nThis plugin requires the following permissions:\n\n- **network**: To communicate with Battle.net servers and Allow2 API for quota checks and access control\n- **configuration**: To read and modify plugin settings, including API credentials and child profile configurations\n\nThese permissions are necessary for the plugin to:\n- Check time quotas with Allow2 services\n- Enable or disable Battle.net access based on quota availability\n- Update child profile settings and track gaming time\n\n## How It Works\n\n1. **Token Extraction**: The plugin accepts Battle.net parent portal tokens in multiple formats:\n   - Full URL: `https://account.blizzard.com/parent-portal/parental-controls/12345?xsrfToken=G0ABCD...`\n   - Token only: `G0ABCD1234567890...` (G0 + 64 hex characters)\n   - Partial URL: `parent-portal/parental-controls/12345?xsrfToken=G0ABCD...`\n\n2. **Browser Automation**: Uses Playwright to:\n   - Authenticate with Battle.net parent portal using the XSRF token\n   - Fetch child account information\n   - Update parental control schedules\n\n3. **Schedule Management**:\n   - Enable gaming: Sets unlimited schedule (all time blocks enabled)\n   - Disable gaming: Blocks all time slots (all time blocks set to 0)\n   - Custom schedules: Supports granular time block configuration\n\n4. **Integration**: Works alongside Allow2 quota system to enforce time limits\n\n## Token Format\n\nBattle.net XSRF tokens follow this pattern:\n- Prefix: `G0`\n- Length: 66 characters total (G0 + 64 hex digits)\n- Characters: Hexadecimal (0-9, A-F)\n- Example: `G0A1B2C3D4E5F6789012345678901234567890123456789012345678901234567890`\n\n## API Usage\n\n### Validate Token\n\n```javascript\nconst TokenValidator = require('@allow2/allow2automate-battle.net/src/TokenValidator');\nconst validator = new TokenValidator();\n\nconst result = validator.validateInput(userInput);\nif (result.success) {\n  console.log('Token:', result.token);\n  console.log('Child ID:', result.childId);\n}\n```\n\n### Portal Client\n\n```javascript\nconst ParentPortalClient = require('@allow2/allow2automate-battle.net/src/ParentPortalClient');\nconst client = new ParentPortalClient({ headless: true });\n\n// Authenticate\nawait client.authenticate(tokenOrUrl, 'parent@email.com');\n\n// Enable gaming\nawait client.enableGaming(childId);\n\n// Disable gaming\nawait client.disableGaming(childId);\n\n// Custom schedule\nawait client.updateSchedule(childId, {\n  enabled: true,\n  monday: 123456,\n  tuesday: 789012,\n  // ... other days\n});\n\n// Cleanup\nawait client.close();\n```\n\n## API Documentation\n\n### Actions\n\n#### `enable`\n- **Name**: Enable Access\n- **Description**: Enable Battle.net access for a child\n- **Parameters**:\n  - `childId` (string): Allow2 child identifier\n  - `activityId` (string): Activity type identifier\n\n#### `disable`\n- **Name**: Disable Access\n- **Description**: Disable Battle.net access for a child\n- **Parameters**:\n  - `childId` (string): Allow2 child identifier\n\n#### `updateQuota`\n- **Name**: Update Quota\n- **Description**: Update time quota from Allow2\n- **Parameters**:\n  - `childId` (string): Allow2 child identifier\n\n### Triggers\n\n#### `quotaExceeded`\n- **Name**: Quota Exceeded\n- **Description**: Triggered when child's time quota is exceeded\n- **Payload**:\n  - `childId` (string): Child identifier\n  - `timeUsed` (number): Total time used in minutes\n  - `quotaLimit` (number): Quota limit in minutes\n\n#### `quotaRenewed`\n- **Name**: Quota Renewed\n- **Description**: Triggered when child's quota is renewed\n- **Payload**:\n  - `childId` (string): Child identifier\n  - `newQuota` (number): New quota amount in minutes\n  - `renewalDate` (date): Date of quota renewal\n\n## Development Setup\n\n```bash\n# Clone the repository\ngit clone https://github.com/Allow2/allow2automate-battle.net.git\ncd allow2automate-battle.net\n\n# Install dependencies\nnpm install\n\n# Start development server with hot reload\nnpm start\n\n# Build for production\nnpm run build\n\n# Run tests\nnpm test\n```\n\n## Requirements\n\n- Node.js 12.0 or higher\n- Allow2Automate 2.0.0 or higher\n- Valid Allow2 account and API credentials\n- Battle.net account\n\n## License\n\nMIT - See [LICENSE](LICENSE) file for details\n\n## Support\n\n- **Issues**: [GitHub Issues](https://github.com/Allow2/allow2automate-battle.net/issues)\n- **Documentation**: [Allow2 Documentation](https://www.allow2.com/docs)\n- **Community**: [Allow2 Community Forums](https://community.allow2.com)\n\n## Contributing\n\nContributions are welcome! Please read our contributing guidelines and submit pull requests to our repository.\n\n## Author\n\nAllow2\n\n## Keywords\n\nallow2automate, battle.net, wow, world of warcraft, plugin, gaming, parental-controls","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallow2%2Fallow2automate-battle.net","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fallow2%2Fallow2automate-battle.net","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallow2%2Fallow2automate-battle.net/lists"}