bekender-remote-config
v0.0.9
Published
### detail documentation
Downloads
278
Maintainers
Readme
Bekender Remote Config from BEKENDER.RU 🍺
detail documentation
installation
yarn add bekender-remote-config
or
npm i bekender-remote-config
usage
for javascript typescript app projects:
import {bekenderRemoteConfig} from "bekender-remote-config"
window.addEventListener('load', async ()=>{
//fetch variables once from remote side when app is opened
const isFetched = await bekenderRemoteConfig.initFetch({
//platform: '',
//remote_config_project_id: '',
//api_key: 'd100f647a8ac41c98...',
//user_uniq_id: '1234',
//lang_key: 'ru',
//version: 1
})
console.log({isFetched})
//use received variables in sync mode (example variable name: "landing_url")
//you can configure your own variables in https://cloud.bekender.ru
const landingUrl = bekenderRemoteConfig.getString('landing_url');
console.log({landingUrl})
})
for html js projects:
<!--bekender remote config connect to web site - add it before closing </body> tag on your site -->
<script src="https://s3.timeweb.cloud/c14a1252-bekender-files/cdn_libraries/bekender-remote-config.cjs.js"></script>
<!--any other your script-->
<script>
window.addEventListener('load', async ()=>{
//fetch variables once from remote side when app is opened
const isFetched = await bekenderRemoteConfig.initFetch({
//platform: '',
//remote_config_project_id: '',
//api_key: 'd100f647a8ac41c98...',
//user_uniq_id: '1234',
//lang_key: 'ru',
//version: 1
})
console.log({isFetched})
//use received variables in sync mode (example variable name: "landing_url")
//you can configure your own variables in https://cloud.bekender.ru
const landingUrl = bekenderRemoteConfig.getString('landing_url');
console.log({landingUrl})
})
</script>
for other platforms projects usage:
curl --location 'https://api.bekender.ru/remote_config_records/fetch_user_remote_config_records' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data '{
"api_key": "c367298e218d0bf58**********",
"remote_config_project_id": "6705ba9262688a65********",
"lang_key": "ru",
"platform": "WEB",
"version": 1
}'
FAQ
Where is the API key ("api_key"):
- get your own api key from your BEKENDER account settings here: https://cloud.bekender.ru/settings
Where is the "remote_config_project_id":
- get your "remote config scheme project id" (ex: id конфигурации: 6705ba9262688a6******)
what these parameters mean: "platform", "user_uniq_id", "lang_key", "version":
- these parameters are optional parameters that can be used for condition variables configuration of a user. The fetched variables list is going to be different for different users base on these parameters.
possible platform values:
- WEB | ANDROID | IOS | DESKTOP
possible lang key values:
- use any lang key that used for your project
Contacts
No-Code & Business & Analytics Cloud Platform BEKENDER.RU
Platform Console CLOUD.BEKENDER.RU
Platform documentation DOC.BEKENDER.RU