Files
cloudly/ts/connector.cloudflare/connector.ts
T
jkunz f40ef6b7c0 chore: update cloudly dependency stack
Align Cloudly with the current typedserver, smartconfig, smartstate, and Docker tooling releases so builds and Docker output stay compatible with the upgraded stack.
2026-05-08 13:56:20 +00:00

27 lines
745 B
TypeScript

import * as plugins from '../plugins.js';
import { Cloudly } from '../classes.cloudly.js';
/**
* the portion of Cloudflare responsible
*/
export class CloudflareConnector {
private cloudlyRef: Cloudly;
public cloudflare?: plugins.cloudflare.CloudflareAccount;
constructor(cloudlyArg: Cloudly) {
this.cloudlyRef = cloudlyArg;
}
// init the instance
public async init() {
const cloudflareToken = await this.cloudlyRef.settingsManager.getSetting('cloudflareToken');
if (!cloudflareToken) {
console.log('warn', 'No Cloudflare token configured in settings. Cloudflare features will be disabled.');
return;
}
this.cloudflare = new plugins.cloudflare.CloudflareAccount(cloudflareToken);
}
}