Skip to content

Open-source solution for running real-time advertising auctions in the cloud.

License

Notifications You must be signed in to change notification settings

rneuplanche/prebid-server

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Go Report Card Go Version



Prebid Server Logo


Prebid Server is an open-source solution for running real-time advertising auctions in the cloud. This project is part of the Prebid ecosystem, seamlessly integrating with Prebid.js and the Prebid Mobile SDKs to deliver world-class header bidding for any ad format and for any type of digital media.

Getting Started

Configuring

When hosting Prebid Server or developing locally, you must set a default GDPR value. This configuration determines whether GDPR is enabled when no regulatory signal is available in the request, where a value of "0" disables it by default and a value of "1" enables it. This is required as there is no consensus on a good default.

Refer to the configuration guide for additional information and a list of available configuration options.

Hosting Prebid Server

Note

Please consider registering as a Prebid Server host to join the mailing list for updates and feedback.

The quickest way to host Prebid Server is to deploy our official Docker image. If you're hosting the container with Kubernetes, you can configure Prebid Server with environment variables using a pod file or using a config map. Alternatively, you can use a configuration file embedded in a config map which Prebid Server will read from at the path /etc/config.

For deploying a fork, you can create a custom Docker container using the command:

docker build --platform linux/amd64 -t prebid-server .

or compile a standalone binary using the command:

go build .

Note: if building from source there are a couple dependencies to be aware of:

  1. Compile-time. Some modules ship native code that requires cgo (comes with the go compiler) being enabled - by default it is and environment variable CGO_ENABLED=1 do NOT set it to 0.
  2. Compile-time. cgo depends on the C-compiler, which usually is gcc, but can be changed by setting the value of CC env var, f.e. CC=clang. On ubuntu gcc can be installed via sudo apt-get install gcc.
  3. Runtime. Some modules require libatomic. On ubuntu it is installed by running sudo apt-get install libatomic1. libatomic1 is a dependency of gcc, so if you are building with gcc and running on the same machine, it is likely that libatomic1 is already installed.

Ensure that you deploy the /static directory, as Prebid Server requires those files at startup.

Developing

Prebid Server requires Go version 1.21 or newer. You can develop on any operating system that Go supports; however, please note that our helper scripts are written in bash.

  1. Clone The Repository
git clone git@github.com:prebid/prebid-server.git
cd prebid-server
  1. Download Dependencies
go mod download
  1. Verify Tests Pass
./validate.sh
  1. Run The Server
go run .

By default, Prebid Server will attach to port 8000. To confirm the server is running, visit http://localhost:8000/ in your web browser.

Code Style

To maintain consistency in the project's code, please:

  • Follow the recommendations set by Effective Go. This article provides a comprehensive guide on how to write idiomatic Go code, covering topics such as naming and formatting. Many IDEs will automatically format your code upon save. If you need to manaully format your code, either run the bash script or execute the make step:

    ./scripts/format.sh -f true
    
    make format
    
  • Prefer small functions with descriptive names instead of complex functions with comments. This approach helps make the code more readable, maintainable, and testable.

  • Do not discard errors. You should implement appropriate error handling, such as gracefully falling back to a default behavior or bubbling up an error.

IDE Recommendation

An option for developing Prebid Server in a reproducible environment isolated from your host OS is using Visual Studio Code with Remote Container Setup. This is a recommendation, not a requirement. This approach is especially useful if you are developing on Windows, since the Remote Container runs within WSL providing you with the capability to execute bash scripts.

Importing Prebid Server

Prebid Server is not currently intended to be imported by other projects. Go Modules is used to manage dependencies, which also makes it possible to import Prebid Server packages. This is not supported. We offer no guarantees regarding the stability of packages and do not adhere to semantic versioning guidelines.

Contributing

Important

All contributions must follow the Prebid Code of Conduct and the Prebid Module Rules.

Bid Adapter

Bid Adapters transform OpenRTB requests and responses for communicating with a bidding server. This may be as simple as a passthrough or as complex as mapping to a custom data model. We invite you to contribute an adapter for your company. Consult our guide on building a bid adapter for more information.

Analytics Module

Analytics Modules enable business intelligence tools to collect data from Prebid Server to provide publishers and hosts with valuable insights into their header bidding traffic. We welcome you to contribute a module for your platform. Refer to our guide on building an analytics module for further information.

Auction Module

Auction Modules allow hosts to extend the behavior of Prebid Server at specfic spots in the auction pipeline using existing modules or by developing custom functionality. Auction Modules may provide creative validation, traffic optimization, and real time data services among many other potential uses. We welcome vendors and community members to contribute modules that publishers and hosts may find useful. Consult our guide on building an auction module for more information.

Feature

We welcome everyone to contribute to this project by implementing a specification or by proposing a new feature. Please review the prioritized project board, where you can select an issue labeled "Ready For Dev". To avoid redundant effort, kindly leave a comment on the issue stating your intention to take it on. To propose a feature, open a new issue with as much detail as possible for consideration by the Prebid Server Committee.

Bug Fix

Bug reports may be submitted by opening a new issue and describing the error in detail with the steps to reproduce and example data. A member of the core development team will validate the bug and discuss next steps. You're encouraged to open an exploratory draft pull request to either demonstrate the bug by adding a test or offering a potential fix. The quickest way to start developing Prebid Server in a reproducible environment isolated from your host OS is by using Visual Studio Code with Remote Container Setup.

Learning Materials

To understand more about how Prebid Server in Go works and quickly spins up sample instances, refer to the sample folder which describes various structured and integrated examples. The examples are designed to run on any platform that supports docker container.

About

Open-source solution for running real-time advertising auctions in the cloud.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 99.9%
  • Other 0.1%