@tanglemedia/svelte-starter-marker-io
v2.0.0
Published
_This package is experimental and is meant for internal use only._
Downloads
37
Readme
@tanglemedia/svelte-starter-marker-io
This package is experimental and is meant for internal use only.
This intergrate marker io automatically into your application. Note that this plugin only works with @tanglemedia/svelte-starter-core >= 0.1.1
and above.
Getting started
Start by creating a new project in https://app.marker.io/ to obtain your project id.
To enable make sure your issue.yml
has the following configuration
default: markerio
enable: true
providers:
markerio:
project: <project-id>
default
needs to be set to markerio and enable
must also be true.
Installation
Install the @tanglemedia/svelte-starter-marker-io
with your favorite package manager.
pnpm add @tanglemedia/svelte-starter-marker-io --filter=my-project
Register the plugin
Within your application boot or where you invoke the createApplication
function, register the markerio plugin.
import { createApplication } from '@tanglemedia/svelte-starter-core';
import { markerIO } from '@tanglemedia/svelte-starter-marker-io';
createApplication({
application: {
// append markerIO to the plugin array
plugin: [markerIO]
}
// ... your other configurations
});
Make sure you are using ApplicationProvider
from @tanglemedia/svelte-starter-core
some where in your top level layout.
Usage
The plugin uses svelte setContext
api to register the marker sdk as a writable store. There is a convenience function for accessing this context. This is only accessible via svelte components that are children on the ApplicationProvider
.
<script lang="ts">
import { getMarkerSDK, getCustomData, getReporter } from '@tanglemedia/svelte-starter-marker-io';
const sdk = getMarkerSDK();
$sdk?.show();
const customData = getCustomData();
const reporter = getReporter();
$customData = { foo: 'bar' };
$reporter = {
email: '[email protected]',
fullName: 'John Doe'
};
</script>