PHPackages                             mvpasarel/typekit-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. mvpasarel/typekit-php

ActiveLibrary[API Development](/categories/api)

mvpasarel/typekit-php
=====================

PHP wrapper for Typekit Developer API

1.1(10y ago)77.4k4MITPHPPHP &gt;=5.4.0

Since Mar 13Pushed 10y ago1 watchersCompare

[ Source](https://github.com/mvpasarel/typekit-php)[ Packagist](https://packagist.org/packages/mvpasarel/typekit-php)[ Docs](https://github.com/mvpasarel/typekit-php)[ RSS](/packages/mvpasarel-typekit-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (3)Versions (4)Used By (0)

mvpasarel/typekit-php
=====================

[](#mvpasareltypekit-php)

[![Latest Version](https://camo.githubusercontent.com/8500d44914727f11210d211dc062e4c0e8c024554082e7a878be0f7e3dad8741/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6d767061736172656c2f747970656b69742d7068702e7376673f7374796c653d666c61742d737175617265)](https://github.com/mvpasarel/typekit-php/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/078afb9f90e5c8d3e7cab8bf5584cbbb0f9f6ca0dd3e6b9e3dc0f5200aad7c26/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6d767061736172656c2f747970656b69742d7068702f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/mvpasarel/typekit-php)[![Coverage Status](https://camo.githubusercontent.com/c453e0ca05850e9421726183c1b1fb707a641fb6a76541ed0eb23b489d2570d2/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f6d767061736172656c2f747970656b69742d7068702e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/mvpasarel/typekit-php/code-structure)[![Quality Score](https://camo.githubusercontent.com/ade140fd79c6f9aecf013a404c89794cdae082c3936315cfc22747d05285f339/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6d767061736172656c2f747970656b69742d7068702e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/mvpasarel/typekit-php)[![Total Downloads](https://camo.githubusercontent.com/2e94a6df508e8919c2d2e5708c4d393f51c1a4a2c2ae1311d67a0f7fe0be5b47/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d767061736172656c2f747970656b69742d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mvpasarel/typekit-php)

Typekit Client implementation with PHP

Install
-------

[](#install)

Via Composer

```
$ composer require mvpasarel/typekit-php

```

Usage
-----

[](#usage)

Initialize the client with your developer API token. You can get your API token [here](https://typekit.com/account/tokens). All method calls return the JSON representation of the return from calling the Typekit API.

```
$typekit = new \Mvpasarel\Typekit\TypekitClient('');

```

### Get all kits

[](#get-all-kits)

To get all your kits, use the following command:

```
$typekit->getKits();

```

### Get kit

[](#get-kit)

To get information about a specific kit, input the kit id as the argument:

```
$typekit->getKit($kitId);

```

### Create kit

[](#create-kit)

To create a new kit, use the method `createKit($name, $domains, $families)`. `Name` and `domains`fields are required, but the `families` field is not.

The arguments are in the following format:

- **$name**: string
- **$domains**: PHP array of strings of format `array('localhost', '*.domain.com', '127.0.0.1')`
- **$families**: set of arrays with the following key =&gt; values
    - 'id' : font family id (string)
    - (optional) 'variations' : comma separated variations (string).

An example of the families format is: `$families = array(array('id' => 'ftnk', 'variations' => 'n3,n4'), array('id' => 'pcpv', 'variations' => 'n4'))` in which case we would create a kit with the font families Futura-PT and Droid Sans with font variations normal 3 ($font-weight:300 and not italicized or strong), normal 4 and normal 4, respectively.

Example usage:

```
$name = 'example typekit kit';

$domains = array('localhost', '*.domain.com');

$families = array(array('id' => 'ftnk', 'variations' => 'n3,n4'), array('id' => 'pcpv', 'variations' => 'n4'));

$typekit->createKit($name, $domains, $families);

```

### Update kit

[](#update-kit)

To create a new kit, use the method `updateKit($kitId, $name='', $domains=array(), $families=array())`. The only required field is `$kitId` and `name`. `domains` and `families` fields are not required.

Field formats are the same as `createKit`.

Example usage:

```
$name = 'Example';

$typekit->updateKit($kitId, $name);

```

### Remove kit

[](#remove-kit)

To remove a kit, use the method `removeKit($kitId)`. The `$kitId` field is required.

```
$typekit->removeKit($kitId);

```

### Publish kit

[](#publish-kit)

To publish a kit, use the method `publishKit($kitId)`. The `$kitId` field is required.

```
$typekit->publishKit($kitId);

```

### Get font family

[](#get-font-family)

To retrieve information regarding a given font family, use the method `getFontFamily($font)`. The argument `font` is a string and can be a Typekit font id or a slug of the font as named in Typekit. The method does not slugify the input, so make sure to slugify it before entering the argument.

```
$typekit->getFontFamily('');

```

### Get font variations

[](#get-font-variations)

To retrieve all possible variations of a given font, use the method `getFontVariations($font)`. The argument is the same as for `getFontFamily($font)`. This method returns a PHP array of all possible variations of the font.

```
$variations = $typekit->getFontVariations('futura-pt'); # using font slug

or

$variations = $typekit->getFontVariations('ftnk'); # using font id

OUTPUT:
array('n3', 'i3', 'n4', 'i4', 'n5', 'i5', 'n7', 'i7', 'n8', 'i8')

```

### Add font to kit

[](#add-font-to-kit)

To add font to kit, use the method `kitAddFont($kitId, $font, $variations)`. Arguments for this method is the same format as the ones above, BUT variations should be in array. Returns nothing.

```
$typekit->kitAddFont('$kitId', 'futura-pt', array(n3,n5,n7));

```

### Remove font from kit

[](#remove-font-from-kit)

To add font to kit, use the method `kitRemoveFont($kitId, $font)`. Arguments for this method is the same format as the ones above, BUT variations should be in array. Returns nothing.

```
$typekit->kitRemoveFont($kitId, 'futura-pt');

```

### Other methods

[](#other-methods)

`getKitValues($kitId)` - Retrieves kit values in an array of format: \[$name, $domains, $families\]

`getKitFonts($kitId)` - Retrieves an array of font ids in a given kit

`kitContainsFont($kitId, $font)` - Checks to see if a font exists in a kit.

Testing
-------

[](#testing)

```
$ TYPEKIT_TOKEN= phpunit

```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please use [Contact Form](http://mvpasarel.com/contact) instead of using the issue tracker.

Credits
-------

[](#credits)

- [Madalin Pasarel](https://github.com/mvpasarel)
- [All Contributors](../../contributors)

Thanks to
---------

[](#thanks-to)

- [Typekit Python](https://github.com/suchanlee/typekit-python)
- [The PHP League](https://github.com/thephpleague/skeleton)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~219 days

Total

2

Last Release

3864d ago

PHP version history (2 changes)1.0PHP &gt;=5.3.0

1.1PHP &gt;=5.4.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/f8d782aae092162a040ca0ed8cf937ec7df73f48ccbc77418617c44556032716?d=identicon)[mvpasarel](/maintainers/mvpasarel)

---

Top Contributors

[![mvpasarel](https://avatars.githubusercontent.com/u/642453?v=4)](https://github.com/mvpasarel "mvpasarel (8 commits)")

---

Tags

typekit

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mvpasarel-typekit-php/health.svg)

```
[![Health](https://phpackages.com/badges/mvpasarel-typekit-php/health.svg)](https://phpackages.com/packages/mvpasarel-typekit-php)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
