Git Product home page Git Product logo

trusted-worklet-server's Introduction



This is not an officially supported Google product.

Teams from across Google, including Ads teams, are actively engaged in industry dialog about new technologies that can ensure a healthy ecosystem and preserve core business models. Online discussions (e.g. on GitHub) of technology proposals should not be interpreted as commitments about Google ads products.


This code provides a server that can run JavaScript bidding and ad scoring functions, as specified in the FLEDGE explainer. The idea is to experiment with moving evaluation of JS from on-device to a server instead.

Discussions of how to add trust to the server are not covered here, see.

Configuring bidding functions

Bidding functions are currently statically configured in a server/sample_configuration.yaml file that gets built into the container. Edit the file to add or change the bidding function that Aviary should be able to run, for example:

  squaring: |
    (function(inputs) { return inputs.perBuyerSignals.contextualCpm * return inputs.perBuyerSignals.contextualCpm; })

Local development

Development environment

In order to be able to build and run Aviary locally, a number of tools need to be installed on the local machine.

  1. Install Python and golang.

  2. Run convenience script to set up the local development environment. It performs the following steps:

Building Aviary

An Aviary server is built as a Docker container.

One can build it with:

bazelisk run //server:aviary

or, if you're not using Bazelisk:

bazel run //server:aviary

Running Aviary locally

You can run Aviary locally with Docker and bind to a chosen local HTTP port:

export PORT=8080; docker run -p ${PORT}:${PORT} -e PORT=${PORT} bazel/server:aviary

To test that Aviary is running, we can send a request to invoke a simple bidding function that doubles the value from perBuyerSignals:

curl -X POST http://localhost:8080/v1alpha/adAuctions:computeBid -d '{"biddingFunctionName": "doubling","input": {"perBuyerSignals": {"contextualCpm": 1.23}}}' -H "Content-type: application/json"
 "bid": 2.46


This code is published so that it‘s possible for anyone to re-run the experiments that we’re doing. This code will not be supported once the experimentation is complete.

trusted-worklet-server's People


 avatar  avatar


 avatar  avatar  avatar  avatar  avatar



Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.