Web Storage & Status API
Web Storage API
Two storage mechanisms on SpinetiX players:
| Object | Persistence | Cleared On |
|---|---|---|
localStorage | Permanent | Manual clear or factory reset |
sessionStorage | Semi-permanent | Player restart or publish |
JavaScript Usage
localStorage.setItem('key', 'value');
var val = localStorage.getItem('key');
localStorage.removeItem('key');
// Store objects as JSON
var data = { name: 'John', score: 100 };
localStorage.setItem('player', JSON.stringify(data));
var restored = JSON.parse(localStorage.getItem('player'));REST API (firmware 4.3.0+)
| Method | Endpoint | Purpose |
|---|---|---|
GET | /api/v1/storage/local | List all keys |
GET | /api/v1/storage/local/[key] | Get value |
POST | /api/v1/storage/local | Set value(s) |
DELETE | /api/v1/storage/local/[key] | Delete key |
Authentication: HTTP Basic with admin rights.
Status API
Monitor player status: identification, temperature, uptime, network, screen, storage.
Endpoint: GET http(s)://[player_address]/status/info
$(function() {
$.get('http://player/status/info', function(data) {
var doc = $.parseXML(data);
var temp = $(doc.documentElement).find('temp').text();
$.textArea({}).text("Temp: " + temp + "°C").addTo('svg');
}, 'text');
});Related Pages
- Shared Variables — SV ↔ localStorage bridge
- Data Feeds & AJAX — fetching status/data
- Player APIs — all API overview