Download the PHP package querri/embed without Composer

On this page you can find all versions of the php package querri/embed. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package embed

querri/embed — PHP SDK

Packagist Version PHP Version

Embed Querri analytics in your PHP application. One method call, zero config.

Laravel | Symfony | Plain PHP | WordPress

PHP SDK for creating embed sessions, managing users, and controlling access policies via the Querri API. Use it with any PHP framework alongside the @querri-inc/embed frontend component. One getSession() call, one server endpoint, and you're done.

Get Started in 60 Seconds

1. Install

2. Create a session

3. Add the embed (React)

4. Wire the endpoint

Set QUERRI_API_KEY and QUERRI_ORG_ID environment variables. In production, always derive user identity from your auth system — never from the request body.

5. Done.

The embed handles auth, token caching, and cleanup automatically.

Security: Always derive user identity and access from your server-side auth system. Never read user or access from the request body — a malicious client can impersonate any user or escalate access.

Configuration

The SDK reads configuration from constructor arguments or environment variables:

Parameter Env Variable Default Description
api_key QUERRI_API_KEY (required) Your Querri API key (qk_...)
org_id QUERRI_ORG_ID (required) Organization ID — every API call needs it (sent as X-Tenant-ID)
host QUERRI_URL https://app.querri.com Querri API host
timeout — 30.0 Request timeout in seconds
max_retries — 3 Max retries on 429/5xx errors
default_origin QUERRI_EMBED_ORIGIN null Origin used for embed sessions when no explicit origin is passed

getSession() — Embed Sessions

The flagship method that creates an embed session in three steps:

  1. User resolution — creates or retrieves a Querri user by your external ID
  2. Access policy — auto-creates or reuses a deterministic policy with row-level filters
  3. Session creation — generates an opaque es_… session token for the embed iframe

With inline access rules

With pre-created policy IDs

Running the session as a custom role

Pass role (a role id or key, at most 100 characters) to run the embed session as one of your organization's custom roles:

roleId is null when no role was applied — and also when an older server ignored role, in which case the session runs as the user's own role. Check it whenever the role matters.

GetSessionResult

Direct Resource Usage

For advanced use cases, access the API resources directly:

Users

Policies

Embed Sessions

Servers released after 2026-10-21 also return role_id from refresh and list; earlier servers return it only from create.

All Resources

Beyond the core embed resources above, the SDK provides full access to the Querri API:

Resource Access Key Methods
$client->dashboards Dashboard management list, create, retrieve, update, del, refresh
$client->projects Analysis projects list, create, retrieve, run, runStatus
$client->chats Chats within projects create, list, retrieve, del, cancel
$client->data Data sources & queries list, create, query, appendRows
$client->sources Connectors & sync listConnectors, list, create, sync
$client->files File management list, retrieve, del
$client->keys API key management create, list, retrieve, revoke
$client->audit Audit log listEvents
$client->usage Usage metrics getOrgUsage, getUserUsage
$client->sharing Sharing & permissions shareProject, shareDashboard, shareSource

See docs/server-sdk.md for complete method signatures and examples.

Error Handling

All errors extend QuerriException. API errors are mapped to specific exception types:

Every ApiException exposes status, errorCode (compare with the ErrorCode constants), type, docUrl, requestId (from the X-Request-Id header), the raw body and headers, and — on a role-system denial (permission_denied) — permission (the permission key, also sent as the X-Permission-Denied header) and reason (role_denied, not_in_plan, flag_off, embed_disabled, dependency_unmet, scope_exceeds_role or forbidden; the server may add more). See the error code table for the codes for authentication, access, Custom Roles and embed sessions; the API sends other codes too, so keep a default branch.

The SDK automatically retries 429 (always) and 5xx (idempotent methods only) with exponential backoff + jitter, up to max_retries attempts.

Example App

See examples/react-embed/ for a complete working example with a PHP backend and React frontend.

Full Reference

See docs/server-sdk.md for the complete API reference, including every method signature, framework integration guides (Laravel, Symfony), error handling details, and the getSession() deep dive.

Troubleshooting

"API key is required" / "Organization ID is required" errors

Set the QUERRI_API_KEY and QUERRI_ORG_ID environment variables (both are required since 1.0.0). An org admin creates API keys at app.querri.com/settings/api.

The SDK checks getenv(), $_ENV, and $_SERVER — covering CLI, Apache, nginx+FPM, and Docker.

Embed is blank / session endpoint returns 500

Verify your PHP endpoint returns JSON with the correct Content-Type:

CORS errors in development

Use Vite's dev proxy to forward /api requests to your PHP server — no CORS headers needed:

Class not found errors

Ensure Composer's autoloader is loaded before using SDK classes:

Important Notes

Requirements

License

MIT

Support policy

Versions below 1.0.0 receive security fixes only, for 6 months from the 1.0.0 release (2026-08-31). Their data-surface methods call routes the server has removed; migrate with docs/MIGRATION.md.


All versions of embed with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
symfony/http-client Version ^7.2
ext-json Version *
ext-hash Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package querri/embed contains the following files

Loading the files please wait ...