PHPackages                             webeau/typekit - 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. webeau/typekit

ActiveLibrary

webeau/typekit
==============

PHP wrapper for Typekit Developer API

2.1(5y ago)09.6kMITPHPPHP &gt;=5.4.0

Since Mar 13Pushed 5y ago3 watchersCompare

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

READMEChangelogDependencies (3)Versions (5)Used By (0)

webeau/typekit
==============

[](#webeautypekit)

Typekit Client implementation with PHP

Install
-------

[](#install)

Via Composer

```
composer require webeau/typekit

```

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 \Webeau\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, $optimize=null)`. `Name` and `domains`fields are required, but the `families` and `optimize` fields are not.

The arguments are in the following format:

- **$name**: string
- **$domains**: PHP array of strings of format `['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).
- \*\*$optimize: boolean

An example of the families format is: `$families = [['id' => 'ftnk', 'variations' => 'n3,n4'], ['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 = ['localhost', '*.domain.com'];

$families = [['id' => 'ftnk', 'variations' => 'n3,n4'], ['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=[], $families=[], $optimize=null)`. 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:
['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', [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)

`optimizeKit($kitId, $optimize)` - Set/unset optimized performance for a kit

`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= composer test

```

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

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity61

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 ~709 days

Total

4

Last Release

1956d ago

Major Versions

1.1 → 2.02016-05-05

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

1.1PHP &gt;=5.4.0

### Community

Maintainers

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

---

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/webeau-typekit/health.svg)

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

###  Alternatives

[neuron-core/neuron-ai

The PHP Agentic Framework.

1.8k245.3k21](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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