wix-twix
Version:
A simple library for managing server and web Wix clients built on top of Wix SDK.
22 lines (21 loc) • 517 B
JavaScript
import { createClient as n } from "@wix/sdk";
import { CLIENT_ENV_MAP as i } from "./wixClient.constants.js";
class c {
constructor({ modules: t }) {
this.client = this.createClient(t);
}
getEnvVariable(t) {
const e = i[t], r = process.env[e];
if (!r)
throw new Error(`Missing ${e} enviroment variable`);
return r;
}
createClient(t) {
const e = this.getAuthStrategy();
return n({ auth: e, modules: t });
}
}
export {
c as WixClient
};
//# sourceMappingURL=wixClient.js.map