Getting started

This section presents what myscript-text-web is and gives you information to start using it.

What is myscript-text-web?

The myscript-text-web element offers the possibility to input handwritten text in any web page. It is a rich editing zone where you can import raw text, edit it with rich gestures and handwriting, convert to type script, manipulate style and export the produced content in raw text or HTML.

Only basic skills in web development are required to start using myscript-text-web. Being familiar with Polymer is not necessary.

As recognition and conversion are processed on the server, it brings some constraints to ensure an optimal user experience. You need a high speed internet connection (latency is the key, as exchanged messages are relatively small except during jiix exports). For content styling, you have to use parameters and JavaScript objects instead of CSS, as the server needs to know the exact user positions.

Supported features

The following features of interactive ink are supported :

Browser support

myscript-text-web supports the latest version of all major browsers: Safari 10+ and the evergreen Chrome, Firefox and Edge.


This guide assumes that you are already familiar with key web-concepts like JavaScript dependencies management and polyfills.

npm and Node.js have to be installed on your working environment.

This guide and relative libraries have been tested on Windows, macOS and Linux.


Use an existing project or start a fresh one with the command below:

npm init

Type the following in your developing folder to install the dependency:

npm install myscript-text-web

Mandatory attributes

As myscript-text-web is relying on either MyScript Cloud or MyScript Server, you have to provide an url and credentials to the server. The default url for MyScript Cloud is

Before using those APIs, you should be registered on MyScript Cloud and have both an application key and an hmac key.

Mandatory attributes

Attribute name Description
apiversion use V4 for iink API
applicationkey The application key provided during registration
hmackey The hmac key provided during registration

myscript-text-web will take care of computing and answering the challenge sent by the server.

You can access a dynamic list of accessible languages with myscript-languages-element

Integration to HTML markup

Create then edit an index.html file in the same folder and add the following lines:

<!doctype html>
  <!-- Those three meta make the capture of handwriting inputs easier on mobile devices -->
  <meta name="viewport" content="width=device-width, minimum-scale=1.3, initial-scale=1.3, user-scalable=no">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="mobile-web-app-capable" content="yes">

  <title>myscript-text-web demo</title>

  <!-- As web components are not fully supported -->
  <script src="node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>

  <!-- myscript-text-web is imported to be used later -->
  <script type="module" src="node_modules/myscript-text-web/myscript-text-web.js"></script>

    body {
      margin: 0;
      height: 95vh;

    myscript-text-web {
      height: 100%;
  <!-- Please change applicationkey and hmackey below with those sent by mail during your registration. You can re-access them by connecting to your dashboard at with your myscript account -->
    applicationkey="YOUR APPLICATION KEY"
    hmackey="YOUR HMAC KEY KEY"

Launch a local Web server to start using it. We recommend to use the polymer one, you can find more information on the Polymer website.

polymer serve

Configuring myscript-text-web with JavaScript

For every attribute modification of myscript-text-web (except for styling, such as strokestyle, strokewidth, etc.), the underlying editor is reinitialized, network connections are closed and reopened to provide the updated context of the recognition to the server. If you want to set multiple attributes of a custom element with JavaScript, this behavior could really slow down your web application. That is where the unloaded attribute comes to the rescue.

This article about custom element interoperability lists the good practices met by myscript-text-web to help you build a fast and interoperable web application.

If you want to set attributes in JavaScript, create your instance of myscript-text-web with only an unloaded attribute set. When loaded into the DOM, the component is attached but remains empty. This gives you the possibility to access it with JavaScript (document.querySelector('myscript-text-web')), so that you are able to set all the needed attributes. The configuration attribute allows you to fine-tune all the possible options available with myscript-text-web.

Read the configuration reference documentation for a full list of supported options.

The programmatic init example code illustrates how to achieve it.

Reference documentation

Other optional attributes, methods and events are listed and documented in the reference documentation. The next sections will drive you through the most important points.

We use cookies to ensure that we give you the best experience on our website Read the privacy policy