Checkers — Angular SDK
Component API reference for @beta-gamer/angular. The beta-gamer-checkers-board component is fully self-contained — it manages its own socket, enforces mandatory captures, handles multi-jump chains, and renders the complete game UI.
Install
npm install @beta-gamer/angular socket.io-clientNgModule import
import { BetaGamerModule } from '@beta-gamer/angular';
@NgModule({ imports: [BetaGamerModule] })
export class AppModule {}<beta-gamer-checkers-board>
Renders the full checkers game UI: 8×8 board, piece selection, valid move indicators, mandatory capture enforcement, king crowning, AFK banner, game-over modal, and resign button.
| Input / Output | Type | Default | Description |
|---|---|---|---|
[showAfkWarning] | boolean | true | @Input — show the built-in AFK countdown banner. |
[showLastMove] | boolean | true | @Input — highlight the from/to squares of the last move. |
[orientation] | "red"|"black"|"auto" | auto | @Input — which color is at the bottom. "auto" uses the color assigned in game:started. |
(onLeave) | EventEmitter | — | @Output — emitted when the player taps Leave or exits the game-over modal. |
Full example
// checkers-game.component.ts
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { BetaGamerService } from '@beta-gamer/angular';
@Component({
selector: 'app-checkers-game',
template: `
<div class="game-screen">
<bg-checkers-board
[showAfkWarning]="true"
[showLastMove]="true"
orientation="auto"
(onLeave)="handleLeave()"
></bg-checkers-board>
</div>
`,
})
export class CheckersGameComponent implements OnInit {
constructor(private svc: BetaGamerService, private router: Router) {}
ngOnInit() {
const token = history.state.sessionToken as string;
// connectSocket: false — the board manages its own socket
this.svc.init(token, 'https://api.beta-gamer.com', '/socket.io', false);
}
handleLeave() { this.router.navigate(['/lobby']); }
}For the full Angular setup walkthrough see the Angular integration guide. For socket event reference see Checkers socket events.
Beta Gamer GaaS API — questions? support@beta-gamer.com