# Whats the best way to implement nakama matchmaking + gamelift server hosting

**URL:** <https://forum.heroiclabs.com/t/whats-the-best-way-to-implement-nakama-matchmaking-gamelift-server-hosting/3204>\
**Category:** Local Setup\
**Created:** [October 27, 2022, 10:48pm UTC](https://forum.heroiclabs.com/t/whats-the-best-way-to-implement-nakama-matchmaking-gamelift-server-hosting/3204 "2022-10-27T22:48:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![crowie](https://avatars.discourse-cdn.com/v4/letter/c/b782af/32.png) [@crowie](https://forum.heroiclabs.com/u/crowie)\
**Post date:** [October 27, 2022, 10:48pm UTC](https://forum.heroiclabs.com/t/whats-the-best-way-to-implement-nakama-matchmaking-gamelift-server-hosting/3204/1 "2022-10-27T22:48:01Z")

</div>

Basically I have a unity project that’s using gamelift for hosting and mirror for networking.  
I want to use nakama to matchmake the players together which I’ve done, but I need to pass the values through to gamelift. What’s the best way to do this?

Thanks for any help!

---

<div class="post-metadata">

**Author:** ![flavio](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/flavio/32/2161_2.png) [@flavio](https://forum.heroiclabs.com/u/flavio)\
**Post date:** [October 28, 2022, 9:09am UTC](https://forum.heroiclabs.com/t/whats-the-best-way-to-implement-nakama-matchmaking-gamelift-server-hosting/3204/2 "2022-10-28T09:09:21Z")

</div>

Hello @crowie,

The recommend component interactions are the following

1. Use Nakama as a “lobby” server that players connect to and matchmake
2. On the matchmaking hook, once complete, you contact Gamelift API to provision a new instance

I hope this diagram helps:

> Client → Nakama → GameLift, then Client → GameLift

The client will maintain a connection to Nakama and new connections to Gamelift instances.

---

<div class="post-metadata">

**Author:** ![crowie](https://avatars.discourse-cdn.com/v4/letter/c/b782af/32.png) [@crowie](https://forum.heroiclabs.com/u/crowie)\
**Post date:** [October 28, 2022, 1:24pm UTC](https://forum.heroiclabs.com/t/whats-the-best-way-to-implement-nakama-matchmaking-gamelift-server-hosting/3204/3 "2022-10-28T13:24:15Z")

</div>

The Nakama to Gamelift bit is the thing I’m having issues with. I’m not 100% on how to pass the values like match ID and player ID through from Nakama to Gamelift so that only they are connected to the session.

---

<div class="post-metadata">

**Author:** ![flavio](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/flavio/32/2161_2.png) [@flavio](https://forum.heroiclabs.com/u/flavio)\
**Post date:** [October 31, 2022, 1:37pm UTC](https://forum.heroiclabs.com/t/whats-the-best-way-to-implement-nakama-matchmaking-gamelift-server-hosting/3204/4 "2022-10-31T13:37:38Z")

</div>

You would setup a matchemaker matched hook that would invoke Gamelift, then it passes the connection details to the client, e.g match ID.

More info on hooks:

> **[Nakama:
    
  
    
    
  
    
    
  
  
  Introduction |

Heroic Labs...](https://heroiclabs.com/docs/nakama/server-framework/introduction/index.html#hooks)**
>
> Documentation for Nakama Open Source, Nakama Enterprise and Heroic Cloud.

---

<div class="post-metadata">

**Author:** ![Albertcleetus](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/albertcleetus/32/603_2.png) [@Albertcleetus](https://forum.heroiclabs.com/u/Albertcleetus)\
**Post date:** [July 19, 2023, 5:07am UTC](https://forum.heroiclabs.com/t/whats-the-best-way-to-implement-nakama-matchmaking-gamelift-server-hosting/3204/5 "2023-07-19T05:07:11Z")

</div>

can Nakama API send a message to each specific player in our party?  
tell them a match is found with this specific name and session ID?  
how it will do.  
@flavio  
@tom
