In javascript use the standard introspection import mechanism to get at libsecret:
const Secret = imports.gi.Secret;
// ... and here's a sample line of code which uses the import
var schema = new Secret.Schema.new("org.mock.Schema",
Secret.SchemaFlags.NONE, { "name", Secret.SchemaAttributeType.STRING });