vue2-postmonger
v1.0.7
Published
Postmonger implementation for the Salesforce Marketing Cloud custom activity development
Downloads
12
Maintainers
Readme
This is postmonger wrapper for Vue.js 2
Installation:
npm i vue2-postmonger
Global install:
import Vue from 'vue';
import VuePostmonger from 'vue2-postmonger';
Vue.use(VuePostmonger);
Local installation (preffered):
import VuePostmonger from 'vue2-postmonger/mixin.js';
export default {
mixins: [VuePostmonger],
data() {},
}
Mixin runs in mounted hook and triggers ready
.
Then mixin will do request to /ui/auth
enpoint to get token. To change endpoint change prop in your component data:
data() {
return {
routes: {
auth: '/ui/auth', // default endpoint
},
}
}
Or set routes.auth
to null
if you don't need to get tokens.
The plugin is using axios for auth calls. Set axios.defaults.baseURL
to add your baseUrl to all axios queries or modify routes.auth
.
If initialization was successful then it runs this.loaded()
method that you have to implement on your side. On this step activity is loaded and you can access majority of properties or run methods described bellow.
Behavior description of implemented postmonger methods:
updateButton()
- update this.button and run this method to update buttonrequestSchema()
- writes data to this.schema and returns itrequestTokens()
- writes data to this.tokens.token, this.tokens.fuel2token and returns itrequestTriggerEventDefinition()
- writes data to this.deid and returns itrequestInteraction()
- writes data to this.interaction and returns itinitActivity()
- writes data to this.activity and returns itupdateActivity()
- update this.activity and run this method to update activityonClickedNext(callback)
onClickedBack(callback)
onGoToStep(callback)
nextStep()
previousStep()
prevStep()
requestDataSources()
- writes data to this.dataSource and returns itregisterAllowedOriginResponse()
- writes data to this.registeredAllowedOriginResponse and returns itrequestInteractionGoalStats()
- writes data to this.interactionGoalStats and returns itrequestActivityPermissions()
- writes data to this.activityPermissions and returns itrequestEngineSettings()
- writes data to this.engineSettings and returns itrequestDataLibrarySource()
- writes data to this.dataLibrarySource and returns itrequestContactsSchema()
- writes data to this.contactsSchema and returns itrequestExpressionBuilderAttributes()
- writes data to this.expressionBuilderAttributes and returns itrequestUserTimeZone()
- writes data to this.userTimeZone and returns itrequestEntryEventDefinitionKey()
- writes data to this.entryEventDefinitionKey and returns itrequestI18nConfig()
- writes data to this.i18nConfig and returns itrequestActivityPayload()
- writes data to this.activityPayload and returns it
Author: Dmitrii Averin