typeset.sh
Search…
⌃K

Installation

Learn how to install and render your first HTML content.

Installation

To install typeset.sh in your PHP project, you have two options: using the PHAR file or Composer. We generally recommend using Composer.

Using phar file

  1. 1.
    Sign up and purchase a license.
  2. 2.
    Download the PHAR file from your project page.
  3. 3.
    Include the PHAR file in your PHP script by adding it to your code.
  4. 4.
    You can then access any typeset.sh functions and classes.
<?php
require_once 'typeset.sh.lib.phar';

Using composer access

To add the repository to your project, run the following command in your Composer project, this will add packages.typeset.sh to your composer.json file.
composer config repositories.typesetsh composer https://packages.typeset.sh
Next, you need to configure Composer to authenticate using your project ID and a token. You can create multiple tokens for different developers or deployment setups if needed. To generate a new token, go to your project page and find the "Create new tokens" option.
Add the token to your global Composer configuration using the command bellow:
composer config -g http-basic.packages.typeset.sh "{PUBLIC_ID}" "{TOKEN}"
Require the typesetsh library by running the following command:
composer require typesetsh/typesetsh
Alternatively, you can use the Symfony bundle or Laravel wrapper, which come with helper functions and services for rendering templates. To use these instead of the typesetsh library, require the Laravel wrapper or Symfony bundle instead:
composer require typesetsh/laravel-wrapper
composer require typesetsh/pdf-bundle

Minimum requirements

Make sure your target environment is running PHP 7.4 or higher and has the PHAR extension installed. The following extensions are also required:
  • ext-curl
  • ext-dom
  • ext-exif
  • ext-fileinfo
  • ext-gd
  • ext-iconv
  • ext-libxml
  • ext-simplexml
  • ext-zlib
PHP 7.4 has reached the end of its lifecycle and we strongly recommend that all users upgrade to the latest version of PHP as soon as they can. However, we understand that this may not always be feasible and will continue to offer support for PHP 7.4 in the meantime.
The test pipeline runs on PHP 7.4, 8.0, 8.1 and 8.2