{"id":475,"date":"2015-12-16T01:04:57","date_gmt":"2015-12-16T01:04:56","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/sync-gateway-webhooks\/"},"modified":"2015-12-16T01:04:57","modified_gmt":"2015-12-16T01:04:56","slug":"sync-gateway-webhooks","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/ko\/sync-gateway-webhooks\/","title":{"rendered":"Sync Gateway Webhooks"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">We just released Couchbase Mobile 1.1 and with this new version comes many\u00a0<a href=\"https:\/\/www.couchbase.com\/blog\/announcing-couchbase-mobile-1.1\/\">new features<\/a>. In this blog post, we\u2019ll take a look at Sync Gateway webhooks\u00a0and think of a few concrete examples for using them.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Webhooks<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Prior to the 1.1 release, the only way to add custom logic in the form of plugins to Sync Gateway was to listen on the changes feed. While this approach still works, it isn\u2019t the easiest to setup. With webhooks, you can simply provide a filter function and the URL to post the event to. Then, you handle the event with the\u00a0<a href=\"https:\/\/www.couchbase.com\/blog\/backend-languages\/\">back-end language<\/a> of your choice (NodeJS, Java, Go, Ruby\u2026).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Webhooks could be used for many different use cases:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Messaging<\/strong>: targeted notifications to inform users of important events.<\/li>\n\n\n<li><strong>Scheduling<\/strong>: kick-off large tasks that may be running on a web worker.<\/li>\n\n\n<li><strong>Custom logic<\/strong>: extend the Sync Function capabilities by using a webhook to perform additional tasks on the document.<\/li>\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">In the following section, you will focus on building the push notification feature for a news application to inform users when new articles that match their topics of interest are published. This tutorial is taken from the <a href=\"https:\/\/github.com\/couchbaselabs\/couchbase-by-example\">Couchbase by Example<\/a>\u00a0repository.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><img decoding=\"async\" src=\"https:\/\/www.couchbase.com\/wp-content\/uploads\/sites\/5\/2026\/05\/gcmnotification.gif\"><\/p>\n\n\n\n<h1 class=\"wp-block-heading\"><strong>Architecture considerations<\/strong><\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">The Push Notification is a visual clue to let the user know that new content is available but it could also be for the application itself to pull the new articles from the server:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><img decoding=\"async\" src=\"https:\/\/www.couchbase.com\/wp-content\/uploads\/sites\/5\/2026\/05\/architecture.png\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The reason we\u2019re using the Web Push API instead of a continuous pull replication with Sync Gateway to check for new articles is that it can work even when the browser is closed. Compared to a web socket or long polling, which will only be kept alive as long as the browser and web page is kept open.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Scenarios<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">There are different scenarios for sending a push notification:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Group Messaging<\/strong>: this concept was introduced in GCM to send notifications to up to 20 devices simultaneously. It\u2019s very well suited for sending notifications to all devices that belong to a single user.<\/li>\n\n\n<li><strong>Up and Down<\/strong>: a user updated a document and other users should be notified about it through a Push Notification.<\/li>\n\n<\/ul>\n\n\n\n<h1 class=\"wp-block-heading\">Data Model<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Let\u2019s start with the smallest document, a Profile document holding registration tokens of the user\u2019s devices and topics of interest:<\/p>\n\n\n<p>[crayon lang=&#8221;json&#8221;]<br \/>\n{<br \/>\n    &#8220;type&#8221;: &#8220;profile&#8221;,<br \/>\n    &#8220;name&#8221;: &#8220;Oliver&#8221;,<br \/>\n    &#8220;subscription&#8221;: &#8220;free&#8221;, \/\/ other values &#8220;expired&#8221;, &#8220;premium&#8221;<br \/>\n    &#8220;topics&#8221;: [&#8220;g20&#8221;, &#8220;science&#8221;, &#8220;nsa&#8221;, &#8220;design&#8221;],<br \/>\n    &#8220;registration_ids&#8221;: [&#8220;AP91DIwQ&#8221;, &#8220;AP91W9kX&#8221;]<br \/>\n}<\/p>\n<p>[\/crayon]<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">And the Article document may have the following properties:<\/p>\n\n\n<p>[crayon lang=&#8221;json&#8221;]<br \/>\n{<br \/>\n    &#8220;type&#8221;: &#8220;article&#8221;,<br \/>\n    &#8220;title&#8221;: &#8220;Design tools for developers&#8221;,<br \/>\n    &#8220;content&#8221;: &#8220;&#8230;&#8221;,<br \/>\n    &#8220;topic&#8221;: &#8220;design&#8221;<br \/>\n}<\/p>\n<p>[\/crayon]<\/p>\n\n\n\n<h1 class=\"wp-block-heading\"><strong>Group Messaging<\/strong><\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Imagine a scenario where a user is currently signed up on a freemium account and inputs a invite code to access the premium plan for a limited time. It would be nice to send a notification to all the user\u2019s devices to fetch the additional content.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Brief<\/strong>: Send a one-off notification to freemium users that also have an invite code to unlock other devices.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Download the <a href=\"https:\/\/www.couchbase.com\/nosql-databases\/downloads#Couchbase_Mobile\">1.1 release<\/a> of Sync Gateway.\u00a0You will find the Sync Gateway binary in the <strong>bin<\/strong>\u00a0folder and examples of configuration files in the <strong>examples<\/strong>\u00a0folder. Copy the <strong>exampleconfig.json<\/strong>\u00a0file to the root of your project:<\/p>\n\n\n<p>[crayon lang=&#8221;bash&#8221;]<br \/>\ncp ~\/Downloads\/couchbase-sync-gateway\/examples\/exampleconfig.json \/path\/to\/proj\/sync-gateway-config.json<\/p>\n<p>[\/crayon]<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Add three users in the configuration file:<\/p>\n\n\n<p>[crayon lang=&#8221;json&#8221;]<br \/>\n{<br \/>\n  &#8220;log&#8221;: [&#8220;CRUD&#8221;, &#8220;HTTP+&#8221;],<br \/>\n  &#8220;databases&#8221;: {<br \/>\n    &#8220;db&#8221;: {<br \/>\n      &#8220;server&#8221;: &#8220;walrus:&#8221;,<br \/>\n      &#8220;users&#8221;: {<br \/>\n        &#8220;zack&#8221;: {<br \/>\n          &#8220;password&#8221;: &#8220;letmein&#8221;<br \/>\n        },<br \/>\n        &#8220;ali&#8221;: {<br \/>\n          &#8220;password&#8221;: &#8220;letmein&#8221;<br \/>\n        },<br \/>\n        &#8220;adam&#8221;: {<br \/>\n          &#8220;password&#8221;: &#8220;letmein&#8221;<br \/>\n        },<br \/>\n        &#8220;GUEST&#8221;: {&#8220;disabled&#8221;: true}<br \/>\n      }<br \/>\n    }<br \/>\n  }<br \/>\n}<\/p>\n<p>[\/crayon]<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Add a web hook with the following properties in the <strong>db<\/strong>\u00a0object:<\/p>\n\n\n<p>[crayon lang=&#8221;json&#8221;]<br \/>\n&#8220;event_handlers&#8221;: {<br \/>\n  &#8220;document_changed&#8221;: [<br \/>\n    {<br \/>\n      &#8220;handler&#8221;: &#8220;webhook&#8221;,<br \/>\n      &#8220;url&#8221;: &#8220;https:\/\/localhost:8000\/invitecode&#8221;,<br \/>\n      &#8220;filter&#8221;: `function(doc) {<br \/>\n            if (doc.type == &#8220;profile&#8221; &#038;&#038; doc.invite_code) {<br \/>\n                return true;<br \/>\n            }<br \/>\n            return false;<br \/>\n        }`<br \/>\n    }<br \/>\n  ]<br \/>\n}<\/p>\n<p>[\/crayon]<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Start Sync Gateway:<\/p>\n\n\n<p>[crayon lang=&#8221;bash&#8221;]<br \/>\n$ ~\/Downloads\/couchbase-sync-gateway\/bin\/sync_gateway .\/sync-gateway-config.json<\/p>\n<p>[\/crayon]<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Create a new file <strong>main.go<\/strong>\u00a0to handle the webhook:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\r\nfunc main() {\r\n    http.HandleFunc(&quot;\/invitecode&quot;, func(w http.ResponseWriter, r *http.Request) {\r\n        log.Println(&quot;ping&quot;)\r\n    })\r\n    log.Fatal(http.ListenAndServe(&quot;:8000&quot;, nil))\r\n}\r\n\r\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Start the Go server:<\/p>\n\n\n<p>[crayon lang=&#8221;bash&#8221;]<br \/>\n$ go run main.go<\/p>\n<p>[\/crayon]<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Using curl, make a POST request to <strong>:4984\/db\/bulk_doc<\/strong>\u00a0to save 3 Profile documents simultaneously:<\/p>\n\n\n<p>[crayon lang=&#8221;bash&#8221;]<br \/>\ncurl -H &#8216;Content-Type: application\/json&#8217;<br \/>\n     -vX POST https:\/\/localhost:4985\/db\/_bulk_docs<br \/>\n     &#8211;data @profiles.json<\/p>\n<p>[\/crayon]<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>NOTE<\/strong>: To save space on the command line, the <strong>&#8211;data<\/strong>\u00a0argument specifies that the request body is in <a href=\"https:\/\/github.com\/couchbaselabs\/Couchbase-by-Example\/blob\/master\/02-gcm-webhook\/profiles.json\">profiles.json<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Notice that only Ali\u2019s Profile document is POSTed to the webhook endpoint:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><img decoding=\"async\" src=\"https:\/\/www.couchbase.com\/wp-content\/uploads\/sites\/5\/2026\/05\/group-messaging.gif\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In the next section, you will configure a second web hook to notify all users when a new article that matches their interest is published.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Up and Down<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Add another webhook entry that filters only documents of type <strong>article<\/strong>:<\/p>\n\n\n<p>[crayon lang=&#8221;json&#8221;]<br \/>\n{<br \/>\n   &#8220;handler&#8221;: &#8220;webhook&#8221;,<br \/>\n   &#8220;url&#8221;: &#8220;https:\/\/localhost:8000\/new_article&#8221;,<br \/>\n   &#8220;filter&#8221;: `function(doc) {<br \/>\n       if (doc.type == &#8220;article&#8221;) {<br \/>\n           return true;<br \/>\n       }<br \/>\n       return false;<br \/>\n   }`<br \/>\n }<\/p>\n<p>[\/crayon]<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Add another handler in your Go server:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\r\nhttp.HandleFunc(&quot;\/new_article&quot;, func(w http.ResponseWriter, r *http.Request) {\r\n    log.Println(&quot;ping&quot;)\r\n})\r\n\r\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Check that the webhook is working as expected by adding an Article document:<\/p>\n\n\n<p>[crayon lang=&#8221;bash&#8221;]<br \/>\ncurl -H &#8216;Content-Type: application\/json&#8217;<br \/>\n     -vX POST https:\/\/localhost:4985\/db\/_bulk_docs<br \/>\n     &#8211;data @articles.json<\/p>\n<p>[\/crayon]<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>NOTE<\/strong>: The content of <strong>articles.json<\/strong>\u00a0can be found <a href=\"https:\/\/github.com\/couchbaselabs\/Couchbase-by-Example\/blob\/master\/02-gcm-webhook\/articles.json\">here<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this case, you have to do a bit more work to figure out what set of users to notify. This is a good use case for using a view to index the Profile documents and emitting the topic as the key and registrations IDs as the value for every topic in the topics array.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To register a view, we can use the Sync Gateway PUT <strong>\/_design\/ddocname<\/strong>\u00a0endpoint with the view definition in the request body:<\/p>\n\n\n<p>[crayon lang=&#8221;bash&#8221;]<br \/>\ncurl -H &#8216;Content-Type: application\/json&#8217;<br \/>\n     -vX PUT https:\/\/localhost:4985\/db\/_design\/extras<br \/>\n     &#8211;data @view.json<\/p>\n<p>[\/crayon]<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>NOTE<\/strong>: The content of <strong>view.json<\/strong>\u00a0can be found <a href=\"https:\/\/github.com\/couchbaselabs\/Couchbase-by-Example\/blob\/master\/02-gcm-webhook\/view.json\">here<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Notice that the article we posted above has design in it\u2019s topic and the only user subscribed to this topic is Adam. Consequently, if you query that view with the key &#8220;design&#8221;, only one (key, value) pair should return with the topic as key and device tokens as value:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\r\ncurl -H &#039;Content-Type: application\/json&#039; \r\n     -vX GET &#039;:4985\/db\/_design\/extras\/_view\/user_topics?key=&quot;design&quot;&#039;\r\n\r\n&lt; HTTP\/1.1 200 OK\r\n&lt; Content-Length: 95\r\n&lt; Content-Type: application\/json\r\n* Server Couchbase Sync Gateway\/1.1.0 is not blacklisted\r\n&lt; Server: Couchbase Sync Gateway\/1.1.0\r\n&lt; Date: Wed, 17 Jun 2015 17:46:35 GMT\r\n&lt;\r\n* Connection #0 to host  left intact\r\n\r\n{&quot;total_rows&quot;:1,&quot;rows&quot;:[{&quot;id&quot;:&quot;4caa204e81b118cf23500f320e138aa8&quot;,&quot;key&quot;:&quot;design&quot;,&quot;value&quot;:null}]}\r\n\r\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now, you can edit the handler in <strong>main.go<\/strong>\u00a0to subsequently query the <strong>user_topics<\/strong>\u00a0view with the key being the topic of the article:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\t\r\nhttp.HandleFunc(&quot;\/new_article&quot;, func(w http.ResponseWriter, r *http.Request) {\r\n\t    log.Println(&quot;ping&quot;)\r\n\t\r\n\t    var data map[string]interface{}\r\n\t    body, _ := ioutil.ReadAll(r.Body)\r\n\t    json.Unmarshal(body, &amp;data)\r\n\t\r\n\t    topic := data[&quot;topic&quot;].(string)\r\n\t    log.Printf(&quot;Querying user Profiles subscribed to %s&quot;, topic)\r\n\t\r\n\t    var stringUrl string = fmt.Sprintf(&quot;https:\/\/localhost:4985\/db\/_design\/extras\/_view\/user_topics?key=&quot;%s&quot;&quot;, topic)\r\n\t    res, err := http.Get(stringUrl)\r\n\t    if err != nil {\r\n\t        fmt.Print(err)\r\n\t        return\r\n\t    }\r\n\t\r\n\t    if res != nil {\r\n\t        var result map[string]interface{}\r\n\t        body, _ = ioutil.ReadAll(res.Body)\r\n\t        json.Unmarshal(body, &amp;result)\r\n\t        log.Printf(&quot;Result from the user_topics query %v&quot;, result[&quot;rows&quot;].([]interface {}))\r\n\t    }\r\n})\r\n\r\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Run the <strong>bulk_doc<\/strong>\u00a0request again and you will see the list of device tokens to use in the logs:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><img decoding=\"async\" src=\"https:\/\/www.couchbase.com\/wp-content\/uploads\/sites\/5\/2026\/05\/up-and-down.gif\"><\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Conclusion<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">In this tutorial, you learned how to use Web Hooks in the scenario of GCM Push Notifications and used Couchbase Server Views to access additional information at Webhook Time\u2122 :).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We just released Couchbase Mobile 1.1 and with this new version comes many\u00a0new features. In this blog post, we\u2019ll take a look at Sync Gateway webhooks\u00a0and think of a few concrete examples for using them. Webhooks Prior to the 1.1 release, the only way to add custom logic in the form of plugins to Sync [&hellip;]<\/p>\n","protected":false},"author":51,"featured_media":18,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"_acf":"","footnotes":""},"categories":[9],"tags":[],"ppma_author":[115],"class_list":["post-475","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-couchbase-mobile"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.6 (Yoast SEO v27.6) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Sync Gateway Webhooks - The Couchbase Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.couchbase.com\/blog\/ko\/sync-gateway-webhooks\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Sync Gateway Webhooks\" \/>\n<meta property=\"og:description\" content=\"We just released Couchbase Mobile 1.1 and with this new version comes many\u00a0new features. In this blog post, we\u2019ll take a look at Sync Gateway webhooks\u00a0and think of a few concrete examples for using them. Webhooks Prior to the 1.1 release, the only way to add custom logic in the form of plugins to Sync [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/ko\/sync-gateway-webhooks\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2015-12-16T01:04:56+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/05\/couchbase-nosql-dbaas.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1800\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"James Nocentini, Technical Writer, Mobile, Couchbase\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"James Nocentini, Technical Writer, Mobile, Couchbase\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/sync-gateway-webhooks\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/sync-gateway-webhooks\\\/\"},\"author\":{\"name\":\"James Nocentini, Technical Writer, Mobile, Couchbase\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#\\\/schema\\\/person\\\/ec4dfbd349cb4a321fb6a92b71a9a7f6\"},\"headline\":\"Sync Gateway Webhooks\",\"datePublished\":\"2015-12-16T01:04:56+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/sync-gateway-webhooks\\\/\"},\"wordCount\":1066,\"commentCount\":5,\"publisher\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/sync-gateway-webhooks\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/5\\\/2026\\\/05\\\/couchbase-nosql-dbaas.png\",\"articleSection\":[\"Couchbase Mobile\"],\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/sync-gateway-webhooks\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/sync-gateway-webhooks\\\/\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/sync-gateway-webhooks\\\/\",\"name\":\"Sync Gateway Webhooks - The Couchbase Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/sync-gateway-webhooks\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/sync-gateway-webhooks\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/5\\\/2026\\\/05\\\/couchbase-nosql-dbaas.png\",\"datePublished\":\"2015-12-16T01:04:56+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/sync-gateway-webhooks\\\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/sync-gateway-webhooks\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/sync-gateway-webhooks\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/5\\\/2026\\\/05\\\/couchbase-nosql-dbaas.png\",\"contentUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/5\\\/2026\\\/05\\\/couchbase-nosql-dbaas.png\",\"width\":1800,\"height\":630},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/sync-gateway-webhooks\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Sync Gateway Webhooks\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/\",\"name\":\"The Couchbase Blog\",\"description\":\"Couchbase, the NoSQL Database\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ko-KR\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#organization\",\"name\":\"The Couchbase Blog\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/5\\\/2026\\\/06\\\/logo.svg\",\"contentUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/5\\\/2026\\\/06\\\/logo.svg\",\"width\":\"1024\",\"height\":\"1024\",\"caption\":\"The Couchbase Blog\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#\\\/schema\\\/person\\\/ec4dfbd349cb4a321fb6a92b71a9a7f6\",\"name\":\"James Nocentini, Technical Writer, Mobile, Couchbase\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0aa80108e5c81e282d705199edae5a25f8ef92abf15cd64f8ff19837abcee09a?s=96&d=mm&r=g09977bdd14473dc23a125f2f74c3e816\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0aa80108e5c81e282d705199edae5a25f8ef92abf15cd64f8ff19837abcee09a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0aa80108e5c81e282d705199edae5a25f8ef92abf15cd64f8ff19837abcee09a?s=96&d=mm&r=g\",\"caption\":\"James Nocentini, Technical Writer, Mobile, Couchbase\"},\"description\":\"James Nocentini is the Technical Writer in charge of the documentation for Couchbase Mobile. Previously, he worked as a Developer Advocate and before that as a front-end developer for HouseTrip. He also enjoys writing Android tutorials for raywenderlich.com in his spare time.\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/ko\\\/author\\\/james-nocentini\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Sync Gateway Webhooks - The Couchbase Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.couchbase.com\/blog\/ko\/sync-gateway-webhooks\/","og_locale":"ko_KR","og_type":"article","og_title":"Sync Gateway Webhooks","og_description":"We just released Couchbase Mobile 1.1 and with this new version comes many\u00a0new features. In this blog post, we\u2019ll take a look at Sync Gateway webhooks\u00a0and think of a few concrete examples for using them. Webhooks Prior to the 1.1 release, the only way to add custom logic in the form of plugins to Sync [&hellip;]","og_url":"https:\/\/www.couchbase.com\/blog\/ko\/sync-gateway-webhooks\/","og_site_name":"The Couchbase Blog","article_published_time":"2015-12-16T01:04:56+00:00","og_image":[{"width":1800,"height":630,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/05\/couchbase-nosql-dbaas.png","type":"image\/png"}],"author":"James Nocentini, Technical Writer, Mobile, Couchbase","twitter_card":"summary_large_image","twitter_misc":{"Written by":"James Nocentini, Technical Writer, Mobile, Couchbase","Est. reading time":"5\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/sync-gateway-webhooks\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/sync-gateway-webhooks\/"},"author":{"name":"James Nocentini, Technical Writer, Mobile, Couchbase","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/ec4dfbd349cb4a321fb6a92b71a9a7f6"},"headline":"Sync Gateway Webhooks","datePublished":"2015-12-16T01:04:56+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/sync-gateway-webhooks\/"},"wordCount":1066,"commentCount":5,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/sync-gateway-webhooks\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/05\/couchbase-nosql-dbaas.png","articleSection":["Couchbase Mobile"],"inLanguage":"ko-KR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/sync-gateway-webhooks\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/sync-gateway-webhooks\/","url":"https:\/\/www.couchbase.com\/blog\/sync-gateway-webhooks\/","name":"Sync Gateway Webhooks - The Couchbase Blog","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/sync-gateway-webhooks\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/sync-gateway-webhooks\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/05\/couchbase-nosql-dbaas.png","datePublished":"2015-12-16T01:04:56+00:00","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/sync-gateway-webhooks\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/sync-gateway-webhooks\/"]}]},{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.couchbase.com\/blog\/sync-gateway-webhooks\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/05\/couchbase-nosql-dbaas.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/05\/couchbase-nosql-dbaas.png","width":1800,"height":630},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/sync-gateway-webhooks\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Sync Gateway Webhooks"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/blog\/#website","url":"https:\/\/www.couchbase.com\/blog\/","name":"The Couchbase Blog","description":"Couchbase, the NoSQL Database","publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ko-KR"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"The Couchbase Blog","url":"https:\/\/www.couchbase.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/06\/logo.svg","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/06\/logo.svg","width":"1024","height":"1024","caption":"The Couchbase Blog"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/ec4dfbd349cb4a321fb6a92b71a9a7f6","name":"James Nocentini, Technical Writer, Mobile, Couchbase","image":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/secure.gravatar.com\/avatar\/0aa80108e5c81e282d705199edae5a25f8ef92abf15cd64f8ff19837abcee09a?s=96&d=mm&r=g09977bdd14473dc23a125f2f74c3e816","url":"https:\/\/secure.gravatar.com\/avatar\/0aa80108e5c81e282d705199edae5a25f8ef92abf15cd64f8ff19837abcee09a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0aa80108e5c81e282d705199edae5a25f8ef92abf15cd64f8ff19837abcee09a?s=96&d=mm&r=g","caption":"James Nocentini, Technical Writer, Mobile, Couchbase"},"description":"James Nocentini is the Technical Writer in charge of the documentation for Couchbase Mobile. Previously, he worked as a Developer Advocate and before that as a front-end developer for HouseTrip. He also enjoys writing Android tutorials for raywenderlich.com in his spare time.","url":"https:\/\/www.couchbase.com\/blog\/ko\/author\/james-nocentini\/"}]}},"acf":[],"authors":[{"term_id":115,"user_id":51,"is_guest":0,"slug":"james-nocentini","display_name":"James Nocentini, Technical Writer, Mobile, Couchbase","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","author_category":"","first_name":"James","last_name":"Nocentini","user_url":"","job_title":"","description":"James Nocentini is the Technical Writer in charge of the documentation for Couchbase Mobile. Previously, he worked as a Developer Advocate and before that as a front-end developer for HouseTrip. He also enjoys writing Android tutorials for raywenderlich.com in his spare time."}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/posts\/475","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/users\/51"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/comments?post=475"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/posts\/475\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/media\/18"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/media?parent=475"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/categories?post=475"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/tags?post=475"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/ppma_author?post=475"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}