Open nizamani opened 2 years ago
import { createHmac } from 'crypto';
const policy = Buffer.from(JSON.stringify({
expiry: Date.now() / 1000 + 30 * 86400 * 630,
call: ['read', 'convert'],
})).toString('base64');
const signature = createHmac('sha256', config.env.FILESTACK_SECRET_KEY)
.update(policy)
.digest('hex');
We want to generate policy and signature using Javascript with nestJS but couldn't find anywhere in documentation how to do this. Right now we are using Php sdk with class FilestackSecurity to generate policy and signature but we want to move everything to JS. That's why I want to ask if there a way that we can use Javascipt server side to generate policy and signature?