Play
Dynamically assemble and match players
Dynamically assemble and match players
Connect cross-platform accounts & identity management
Grow and commercialize your game
Build a vibrant community
Track player progression and game state across platforms
Track, engage, and retain players
Visualize game metrics
With AccelByte Cloud, we are enabling game studios to focus on building experiences to delight their players, while we take care of the complexity of running the servers 24/7 as a fully managed service.
Using our Unity and UE4 SDKs, game developers call into our API endpoints, and integrate our online features into their games.
But with the recent trend of Games as a Service and Cross-Platform Gaming, we see a need to shift a lot of logic from Game Clients to the Backend. This helps developers create an engaging, fair, and safe experience for all of their players, regardless of which platforms they are playing on.
Here are some examples of logic that can only be run securely on the Backend:
Previously, there were two ways you could extend AccelByte Cloud’s capabilities:
And now we’re introducing an exciting third option with the release of our Services SDK collection, starting with our Golang SDK.
What is it for?
It is an SDK that lets you write services that talk to your AccelByte services in a secure, S2S fashion.
When to use Golang SDK:
Quick Demonstration
Let’s see the Golang Service SDK in action. In this simple tutorial, we are going to create a simple AWS Lambda function that uses our Golang SDK to interact with our Statistics service on behalf of a user. If you’d like to learn more about our Statistics service, please check out this article.
These are the high level steps that we will implement:
Detailed steps:
For more details about AccelByte permission setup, please read our Permissions documentation.
2. Create a new AWS Lambda from the AWS Console. Make sure to set the Lambda Runtime to be Golang 1.x.
In your Golang code, import github.com/AccelByte/accelbyte-go-sdk v0.1.0 in your go.mod.
This is the code snippet:
func main() {
lambda.Start(Handler)
}
func Handler(request *Request) (interface{}, error) {
accessToken := request.AccessToken
tokenResponseV3, err := convertTokenToTokenResponseV3(accessToken)
if err != nil {
return nil, err
}
tokenRepositoryImpl := &TokenRepositoryImpl{}
if tokenResponseV3 != nil {
err = tokenRepositoryImpl.Store(*tokenResponseV3)
if err != nil {
return nil, err
}
}
return createUserStatItem(request.Params, tokenRepositoryImpl)
}
func createUserStatItem(params RequestParams, tokenRepositoryImpl *TokenRepositoryImpl) (interface{}, error) {
statisticService := service.StatisticService{
SocialServiceClient: factory.NewSocialClient(&ConfigRepositoryImpl{}),
TokenRepository: tokenRepositoryImpl,
}
err := statisticService.CreateUserStatItem(params.Namespace, params.UserID, params.StatCode)
if err != nil {
return nil, err
}
return nil, nil
}
Set the environment variable of your Lambda to APP_CLIENT_ID , APP_CLIENT_SECRET with the client ID and secret from the Admin Portal. This allows us to determine the right permissions and scope for the calls.
3. Create an AWS API-Gateway to make a Lambda function so it can be triggered by either a POST or GET HTTP request.
Create a new API, and make sure to set REST as the protocol. Set it to integrate with your Lambda, as seen in the image below:
Deploy your API. You should get an Invoke URL.
4. To test this out, you can use your favorite HTTP client like Postman to make a request to the AWS API-Gateway with these parameters: IAM access token, request body, AWS access key, and AWS secret key.
When you invoke the function, it will update the User Statistics.
Q&A
Will there be more language runtimes supported, like TypeScript, C#, or Java?
Yes! Please reach out to us if you are interested to learn more about the Service SDKs we have in the works.
Learn More
You can find our Golang SDK in our public Github.
Interested in learning more about our solutions? Get in touch here.
Reach out to the AccelByte team to learn more.