About new Sudoku
Embed Sudoku
Add Sudoku to your website with our simple embed code.
Quick Start
1. Get your API key from the panel below
<div id="sudoku-game"></div>
2. Add the script tag to your HTML
<script src="https://about-new.com/js/sudoku/sudoku.js"></script>
3. Initialize with your container and options
<script>
AboutNewSudoku.init('#sudoku-game', {
apiBase: 'https://www.czechindex.webcam/api/v1/tools/sudoku',
difficulty: 'medium',
apiKey: 'YOUR_API_KEY'
});
</script>
Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
container |
string | - |
CSS selector for the container element |
difficulty |
string | "medium" |
Starting difficulty: medium, hard, expert |
theme |
string | "light" |
Color theme: light or dark |
showTimer |
boolean | true |
Show/hide the timer |
showHints |
boolean | true |
Enable/disable hints button |
apiKey |
string | - |
Your API key (required) |
onComplete |
function | - |
Callback when puzzle is completed. Receives: {puzzleId, time, formattedTime} |
onStart |
function | - |
Callback when new game starts. Receives puzzle data. |
onError |
function | - |
Callback when error occurs. Receives error object. |
Examples
Basic Setup
AboutNewSudoku.init('#sudoku-game', {
apiBase: 'https://www.czechindex.webcam/api/v1/tools/sudoku',
apiKey: 'YOUR_API_KEY'
});
Dark Theme
AboutNewSudoku.init('#sudoku-game', {
apiBase: 'https://www.czechindex.webcam/api/v1/tools/sudoku',
apiKey: 'YOUR_API_KEY',
theme: 'dark'
});
Without Timer
AboutNewSudoku.init('#sudoku-game', {
apiBase: 'https://www.czechindex.webcam/api/v1/tools/sudoku',
apiKey: 'YOUR_API_KEY',
showTimer: false,
difficulty: 'hard'
});
With Result Callback
AboutNewSudoku.init('#sudoku-game', {
apiBase: 'https://www.czechindex.webcam/api/v1/tools/sudoku',
apiKey: 'YOUR_API_KEY',
onComplete: function(result) {
// Send result to your backend
console.log('Puzzle completed!', result);
// result = { puzzleId: 123, time: 180, formattedTime: "3:00" }
// Example: Save to your database
fetch('/your-api/save-sudoku-result', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
puzzle_id: result.puzzleId,
time_seconds: result.time
})
});
},
onStart: function(puzzle) {
console.log('New game started:', puzzle);
// puzzle = { id: 123, difficulty: "medium" }
}
});