Skip to content

Authentication

Sampli edited this page Jun 28, 2021 · 5 revisions

authenticate()

  • This method must be called at least once to authenticate to the Skincrib websocket server. If reconnect was set to false in the constructor, you will need to call this every time you get disconnected.
  • Will return merchant data, and emit the authenticated event.

Example:

market.on('authenticated', (data)=>{
 console.log(data); //merchant data
});

market.authenticate()
.then((data)=>{
 console.log(data); //merchant data
}, (error)=>{
 console.error(error); //authentication error
});

Example Authenticate Response:

{
  steamid: '84561193023082129', 
  balance: 0,
  transactions: [{
   steamid: '84561194023032129', //client steam id
   type: 'deposit', //listing type
   timestamp: 1657654526759, //time of transaction
   item: {
    name: 'P250 | Splash (Factory New)',
    icon: '-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXH5ApeO4YmlhxYQknCRvCo04DEVlxkKgpopujwezhzw8zbYTFD_9SJhNLex8j4OrzZgiUIupIhjrHFpNj22w21rhVkYG3zI9PEdwZrZFmG-gTsyee8hJG-up6d1zI97bay_VK1', //steam icon hash
    price: 3
   }
  }, ...],
  dateRegistered: 1657654526759,
  dateUpdated: 16248584565648
}
Clone this wiki locally