@tanglemedia/svelte-starter-marker-io
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

This package is experimental and is meant for internal use only.

TypeScript NPM Version Repo Bitbucket Bitbucket open pull requests NPM License

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: 'test@example.com',
		fullName: 'John Doe'
	};
</script>

For mode demos and to check out all the components, please visit our documentation website

Readme

Keywords

none

Package Sidebar

Install

npm i @tanglemedia/svelte-starter-marker-io

Weekly Downloads

4

Version

2.0.0

License

MIT

Unpacked Size

16.2 kB

Total Files

28

Last publish

Collaborators

  • tanglemedia-dev