import { Meteor } from 'meteor/meteor'; import { ServiceConfiguration } from 'meteor/service-configuration'; const OAuthSettings = Meteor.settings.private.OAuth; if (OAuthSettings) { // Meteor 3: sync Mongo write-methods are gone on the server; use *Async. // Top-level await is supported in eager server modules. for (const service of Object.keys(OAuthSettings)) { await ServiceConfiguration.configurations.upsertAsync( { service }, { $set: OAuthSettings[service] }, ); } }