< Our trainings

Introduction to Mercure

Discover Mercure protocol basics and learn how to use it with PHP via Symfony and API Platform
Register
800/ attendee

Practical information

  • 1 day
  • On site
  • Schedules 9:00-12:30 / 13:30 - 17:00
  • Training rooms accessible to people with reduced mobility

Need more information?

Contact us

Goals

Mercure is a protocol for delivering real-time data updates to web browsers (or other HTTP clients) in a reliable, fast, and energy-efficient way. Mercure is useful for publishing real-time updates on resources exposed through web APIs.

Prerequisites

  • Working knowledge of PHP and OOP
  • Own laptop

Program

Introducing the protocol

Use cases
  • Live availability
  • Asynchronous work
  • Collaborative editing

 

Similarities and differences with prior protocols
  • With Server-Sent Events
  • With Websocket
  • With Websub
  • With Webpush

 

Introducing HTTP/2 and its use in Mercure

 

Introducing HTTP/3 and its use in Mercure

 

The hub

  • Classic install
  • Docker install
  • Kubernetes install
  • Automatic support for HTTP/2 and HTTPS (via Let’s Encrypt)
  • Configuation
  • Alternative implementation (node.js hub)

Client side

  • Javascript : the EventSource class
  • Cross-domain cookies considerations
  • Configuring CORS
  • Polyfill for old browsers

Authorisation

  • Introducing Mercure authorization mechanics
  • Introducing JWT tokens format
  • Targets
  • Publishing rights
  • Subscribing rights
  • Authorisation via cookies
  • Authorisation via HTTP headers

Mercure and the APIs

  • Reminders on REST, HATEOAS and Hypermedia
  • Introduction to Mercure auto-discovery mechanics via Web Linking
  • Using Mercure for GraphQL subscriptions

Mercure Integration within major frameworks and languages

  • API-Platform and Symfony example (PHP, via Hub)
  • Node.js example (via Hub)
  • Without hub using Go
  • Without hub using Node.js

End to end encryption

 

Our trainers

Discover our team !

Antoine BLUCHET

Principal developer

Full-Stack expert, Antoine has been contributing to Open Source software for almost 10 years. Author and maintainer of JavaScript modules, he also contributes to Symfony or API Platform. He also masters Node.js and many JavaScript frameworks (Nest, Angular, React). As an architect, implementing and supporting teams on these technologies are his daily job. He is also a trainer, blogger and speaker.

Grégoire HÉBERT

Principal developer

Specialist of PHP with Symfony and API Platform, author of a book on REST, speaker and teacher, Grégoire likes to share his skills in order to set up qualitative projects thanks to his 10 years of experience in development, consulting, audit and architecture.

Kévin DUNGLAS

CEO

Kévin is the founder of Les-Tilleuls.coop. He’s a member of Symfony’s core-team and the creator of the API Platform framework. He’s a contributor to over a hundred Open Source projects, and is also a conference speaker, an article and technical book writer as well as a lecturer at Lille University.