PHPackages                             jahuty/snippets-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. jahuty/snippets-php

Abandoned → [jahuty/jahuty-php](/?search=jahuty%2Fjahuty-php)Library[Utility &amp; Helpers](/categories/utility)

jahuty/snippets-php
===================

Jahuty's PHP client

v1.0.0(6y ago)16[3 issues](https://github.com/jahuty/snippets-php/issues)MITPHPPHP ^7.3CI failing

Since Sep 2Pushed 4y ago2 watchersCompare

[ Source](https://github.com/jahuty/snippets-php)[ Packagist](https://packagist.org/packages/jahuty/snippets-php)[ RSS](/packages/jahuty-snippets-php/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (4)Versions (2)Used By (0)

[![CircleCI](https://camo.githubusercontent.com/d40a496614a6ba37c1d1f5554e4b1c14815d4a15096387344b91d0fdcfe0db7b/68747470733a2f2f636972636c6563692e636f6d2f67682f6a61687574792f6a61687574792d7068702e7376673f7374796c653d737667)](https://circleci.com/gh/jahuty/jahuty-php) [![codecov](https://camo.githubusercontent.com/086875384e8e088c81adb0eaee6293f95c01fd26328fac6f7a9e4136aed52813/68747470733a2f2f636f6465636f762e696f2f67682f6a61687574792f6a61687574792d7068702f6272616e63682f6d61737465722f67726170682f62616467652e7376673f746f6b656e3d58454c50493446574d49)](https://codecov.io/gh/jahuty/jahuty-php)

jahuty-php
==========

[](#jahuty-php)

Welcome to the PHP SDK for [Jahuty's API](https://docs.jahuty.com/api)!

Installation
------------

[](#installation)

This library requires [PHP 7.3+](https://secure.php.net).

It is multi-platform, and we strive to make it run equally well on Windows, Linux, and OSX.

It should be installed via [Composer](https://getcomposer.org). To do so, add the following line to the `require` section of your `composer.json` file, and run `composer update`:

```
{
   "require": {
       "jahuty/jahuty-php": "^5.4"
   }
}
```

Usage
-----

[](#usage)

Instantiate the library with your [API key](https://docs.jahuty.com/api#authentication) and use the `snippets->render()` method to render your snippet:

```
$jahuty = new \Jahuty\Client('YOUR_API_KEY');

$render = $jahuty->snippets->render(YOUR_SNIPPET_ID);
```

Then, output the render's content by casting it to a `string` or using its `getContent()` method:

```
$jahuty = new \Jahuty\Client('YOUR_API_KEY');

$render = $jahuty->snippets->render(YOUR_SNIPPET_ID);

echo $render;
echo $render->getContent();
```

In an HTML view:

```
