> For the complete documentation index, see [llms.txt](https://satangdev.gitbook.io/satang-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://satangdev.gitbook.io/satang-api/sign-request-example/javascript.md).

# Javascript

### **Example Signing Code in Javascript**

Signing request param with `encrypt(apiSecret, str)` function&#x20;

```
const crypto = require("crypto")

let api_secret = '...'

let encrypt = (apiSecret, str) => {
    let hmac = crypto.createHmac("sha512", apiSecret);
    let signed = hmac.update(str).digest('hex');
    
    return signed;
}

let request_header = 'amount='+String(order.amount)+'&nonce='+String(order.nonce)+'&pair='+String(order.pair)+'&price='+String(order.price)+'&side='+String(order.side)+'&type='+String(order.type)

let signed = encrypt(api_secret, request_header)
```
