@openlettermarketing/olc-react-sdk 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -27,8 +27,7 @@ import TemplateBuilder from '@openlettermarketing/olc-react-sdk';
27
27
  const templateBuilderProps = {
28
28
  container: document.getElementById('element-id'),
29
29
  secretKey: 'your-secret-key',
30
- basicAuthUsername: 'your-username',
31
- basicAuthPassword: 'your-password',
30
+ publicApiKey: 'your-api-key',
32
31
  platformName: 'Your Platform Name',
33
32
  createTemplateRoute: '/create-template',
34
33
  templateBuilderRoute: '/edit-template',
@@ -66,13 +65,13 @@ The SDK uses several properties to manage its behavior. Below is a breakdown of
66
65
  |------------------------|:-----------------|----------------------------------------------------------------------------------------------------------------|----------|:-----------------------------------------------------------|
67
66
  | `container` | _HTMLDivElement_ | An HTML DOM element to render the template builder component. | ✓ | `document.getElementById('template-builder-container')` |
68
67
  | `secretKey` | _string_ | That key is used to communicate _Polotno_ Editor (Builder) with API requests. | ✓ | `'your-secret-key'` |
69
- | `basicAuthUsername` | _string_ | _Username_ for basic authentication. | ✓ | `'your-username'` |
70
- | `basicAuthPassword` | _string_ | _Password_ for basic authentication. | ✓ | `'your-password'` |
68
+ | `publicApiKey` | _string_ | _publicApiKey_ is used for basic authentication between the OLC and the client platform. | ✓ | `'your-api-key'` |
71
69
  | `platformName` | _string_ | The name of your platform. | ⤫ | `'My App'` |
72
70
  | `createTemplateRoute` | _string_ | The route/path for creating new templates. _(begins with slash `/`)_ | ⤫ | `'/create-template'` |
73
71
  | `templateBuilderRoute` | _string_ | The route/path for editing existing templates. _(begins with slash `/`)_ | ⤫ | `'/edit-template'` |
74
72
  | `olcTemplate` | _object_ | The template object to be edited or used as a base. | ⤫ | `{ ... }` |
75
- | `sandbox` | _boolean_ | The sandbox setting can be either true or false. Set to true for demo purposes and false for production. | ⤫ | `true` |
73
+ | `sandbox` | _boolean_ | The sandbox setting can be either true or false. Set to true for demo purposes and false for production. | ⤫ | `true` |
74
+ | `allowSenderFields` | _boolean_ | The allowSenderFields prop can be set to either true or false. When set to true, it makes the sender fields visible in the custom fields section. | ⤫ | `true` |
76
75
  | `onReturnAndNavigate` | _function_ | An event which triggers when a user navigates away. | ⤫ | `onReturnAndNavigate () { ... }` |
77
76
  | `onGetOneTemplate` | _function_ | An event which triggers when fetching a specific template. | ⤫ | `onGetOneTemplate ( payload ) { ... }` |
78
77
  | `onGetTemplates` | _function_ | An event which triggers when fetching all templates. | ⤫ | `onGetTemplates ( payload ) { ... }` |
@@ -103,8 +102,7 @@ const App = () => {
103
102
  TemplateBuilder({
104
103
  container: document.getElementById('template-builder-container'),
105
104
  secretKey: 'your-secret-key',
106
- basicAuthUsername: 'your-username',
107
- basicAuthPassword: 'your-password',
105
+ publicApiKey: 'your-api-key',
108
106
  sandbox: false,
109
107
  async onSubmit (payload) {
110
108
  console.log('Template submitted:', payload);