{"id":454089,"date":"2025-04-01T16:09:23","date_gmt":"2025-04-01T16:09:23","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=454089"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=454089","title":{"rendered":"<span>\u042f\u043d\u0434\u0435\u043a\u0441 SmartCaptcha \u0432 Angular<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u044d\u043f\u043e\u0445\u0443 \u043c\u0430\u0441\u0441\u043e\u0432\u044b\u0445 \u0431\u043e\u0442\u043d\u0435\u0442\u043e\u0432 \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0430\u0442\u0430\u043a \u0437\u0430\u0449\u0438\u0442\u0430 \u0432\u0435\u0431-\u0444\u043e\u0440\u043c \u0441\u0442\u0430\u043b\u0430 \u043d\u0435\u043e\u0442\u044a\u0435\u043c\u043b\u0435\u043c\u043e\u0439 \u0447\u0430\u0441\u0442\u044c\u044e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0430 \u044d\u0442\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0434\u043b\u044f \u0440\u043e\u0441\u0441\u0438\u0439\u0441\u043a\u0438\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u043f\u043e\u0441\u043b\u0435 \u0443\u0445\u043e\u0434\u0430 \u043c\u043d\u043e\u0433\u0438\u0445 \u0437\u0430\u0440\u0443\u0431\u0435\u0436\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0441 \u0440\u044b\u043d\u043a\u0430. \u041e\u0434\u043d\u0438\u043c \u0438\u0437 \u043e\u0442\u0435\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439, \u043f\u0440\u0438\u0437\u0432\u0430\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0432\u0448\u0443\u044e\u0441\u044f \u043d\u0438\u0448\u0443, \u0441\u0442\u0430\u043b\u0430 \u042f\u043d\u0434\u0435\u043a\u0441 SmartCaptcha \u2014 \u0440\u043e\u0441\u0441\u0438\u0439\u0441\u043a\u0430\u044f \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0430 Google reCAPTCHA.<\/p>\n<p>\u0425\u043e\u0442\u044f \u042f\u043d\u0434\u0435\u043a\u0441 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0434\u043b\u044f React, \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0441 Angular \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u0438\u043b\u0438\u0439.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u044b \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e Angular-\u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0430, \u0435\u0433\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u0438 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/xy\/cx\/-k\/xycx-kfi5glwmhxhsw47twfwyyo.png\" data-src=\"https:\/\/habrastorage.org\/webt\/xy\/cx\/-k\/xycx-kfi5glwmhxhsw47twfwyyo.png\"\/><\/figure>\n<h3>\u041f\u043e\u0434\u0445\u043e\u0434 \u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438<\/h3>\n<p>\u041f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 Angular-\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044f \u0441\u0442\u0440\u0435\u043c\u0438\u043b\u0441\u044f \u0443\u0447\u0435\u0441\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0438:<\/p>\n<ol>\n<li>\n<p>\u041f\u043e\u043b\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u0441\u0435\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e JavaScript API.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 Angular-\u043f\u043e\u0434\u0445\u043e\u0434\u0430\u043c \u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0441 \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u043c\u0438 \u0444\u043e\u0440\u043c\u0430\u043c\u0438.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 Angular: \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 standalone-\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432 \u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0432 zoneless-\u0440\u0435\u0436\u0438\u043c\u0435.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u043c \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u043e\u043c (SSR).<\/p>\n<\/li>\n<\/ol>\n<h3>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/h3>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u0432\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430:<\/p>\n<ol>\n<li>\n<p><strong>SmartCaptchaComponent<\/strong> \u2014 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u043a\u0430\u043f\u0447\u0430 \u0441 \u0432\u0438\u0434\u0438\u043c\u044b\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435.<\/p>\n<\/li>\n<li>\n<p><strong>InvisibleSmartCaptchaComponent<\/strong> \u2014 \u043d\u0435\u0432\u0438\u0434\u0438\u043c\u0430\u044f \u043a\u0430\u043f\u0447\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e.<\/p>\n<\/li>\n<\/ol>\n<p>\u041e\u0431\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b <code>ControlValueAccessor<\/code> \u0438 <code>Validator<\/code>, \u0447\u0442\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0431\u0435\u0441\u0448\u043e\u0432\u043d\u0443\u044e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u0441 \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u043c\u0438 \u0444\u043e\u0440\u043c\u0430\u043c\u0438 Angular.<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f<\/h3>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0432 \u0444\u043e\u0440\u043c\u0435:<\/p>\n<pre><code class=\"typescript\">import { Component } from '@angular\/core'; import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular\/forms'; import { SmartCaptchaComponent } from '@ngx-rock\/yandex-smart-captcha';  @Component({   selector: 'app-contact-form',   standalone: true,   imports: [ReactiveFormsModule, SmartCaptchaComponent],   template: `     &lt;form [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\"&gt;       &lt;div class=\"form-group\"&gt;         &lt;label for=\"email\"&gt;\u041f\u043e\u0447\u0442\u0430&lt;\/label&gt;         &lt;input type=\"text\" id=\"email\" formControlName=\"email\"&gt;       &lt;\/div&gt;              &lt;div class=\"form-group\"&gt;         &lt;smart-captcha           formControlName=\"captcha\"           [sitekey]=\"'YOUR_SITE_KEY'\"           (success)=\"onCaptchaSuccess($event)\"         \/&gt;       &lt;\/div&gt;              &lt;button type=\"submit\" [disabled]=\"form.invalid\"&gt;\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c&lt;\/button&gt;     &lt;\/form&gt;   ` }) export class ContactFormComponent {   form: FormGroup;      constructor(private fb: FormBuilder) {     this.form = this.fb.group({       email: ['', Validators.required],       captcha: [null, Validators.required]     });   }      onCaptchaSuccess(token: string): void {     console.log('\u041a\u0430\u043f\u0447\u0430 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043f\u0440\u043e\u0439\u0434\u0435\u043d\u0430:', token);   }      onSubmit(): void {     if (this.form.valid) {       const formData = this.form.value;       \/\/ formData.captcha \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0442\u043e\u043a\u0435\u043d \u043a\u0430\u043f\u0447\u0438     }   } } <\/code><\/pre>\n<h3>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0435\u0432\u0438\u0434\u0438\u043c\u043e\u0439 \u043a\u0430\u043f\u0447\u0438<\/h3>\n<p>\u041d\u0435\u0432\u0438\u0434\u0438\u043c\u0430\u044f \u043a\u0430\u043f\u0447\u0430 (invisible captcha) \u2014 \u043e\u0441\u043e\u0431\u044b\u0439 \u0440\u0435\u0436\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u044b, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439. \u042d\u0442\u043e\u0442 \u0440\u0435\u0436\u0438\u043c \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043f\u043e\u043b\u0435\u0437\u0435\u043d \u0434\u043b\u044f \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0432\u0435\u0440\u0441\u0438\u0438 \u0444\u043e\u0440\u043c, \u0433\u0434\u0435 \u043b\u0438\u0448\u043d\u0438\u0435 \u0448\u0430\u0433\u0438 \u043c\u043e\u0433\u0443\u0442 \u043e\u0442\u043f\u0443\u0433\u043d\u0443\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.<\/p>\n<p>\u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0435\u0432\u0438\u0434\u0438\u043c\u043e\u0439 \u043a\u0430\u043f\u0447\u0438 \u0432 Angular:<\/p>\n<pre><code class=\"typescript\">&lt;form [formGroup]=\"form\" (ngSubmit)=\"submitForm()\"&gt;   &lt;!-- \u0414\u0440\u0443\u0433\u0438\u0435 \u043f\u043e\u043b\u044f \u0444\u043e\u0440\u043c\u044b --&gt;      &lt;invisible-smart-captcha     formControlName=\"captcha\"     [sitekey]=\"'YOUR_SITE_KEY'\"     [visible]=\"submitAttempted\"     (success)=\"onCaptchaSuccess($event)\"   \/&gt;      &lt;button type=\"submit\"&gt;\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c&lt;\/button&gt; &lt;\/form&gt; <\/code><\/pre>\n<pre><code class=\"typescript\">submitForm(): void {   this.submitAttempted = true; \/\/ \u042d\u0442\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442 \u043d\u0435\u0432\u0438\u0434\u0438\u043c\u0443\u044e \u043a\u0430\u043f\u0447\u0443      \/\/ \u0424\u043e\u0440\u043c\u0430 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043a\u0430\u043f\u0447\u0438   \/\/ \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0442\u043e\u043a\u0435\u043d\u0430 (\u0447\u0435\u0440\u0435\u0437 onCaptchaSuccess) }  onCaptchaSuccess(token: string): void {   this.apiService.sendFormWithCaptcha(this.form.value, token)     .subscribe(response =&gt; {       \/\/ \u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043e\u0442\u0432\u0435\u0442\u0430     }); } <\/code><\/pre>\n<h3>\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043e\u0448\u0438\u0431\u043e\u043a \u0438 \u0433\u0440\u0430\u043d\u0438\u0447\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432<\/h3>\n<p>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u0432\u043d\u0435\u0448\u043d\u0438\u043c\u0438 API \u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u0432\u044f\u0437\u0430\u043d\u0430 \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u043c\u0438 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438. \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432:<\/p>\n<ol>\n<li>\n<p><strong>\u0421\u0435\u0442\u0435\u0432\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438<\/strong> \u2014 \u043a\u043e\u0433\u0434\u0430 \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d.<\/p>\n<\/li>\n<li>\n<p><strong>JavaScript-\u043e\u0448\u0438\u0431\u043a\u0438<\/strong> \u2014 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0449\u0438\u0435 \u0432 \u043a\u043e\u0434\u0435 \u043a\u0430\u043f\u0447\u0438.<\/p>\n<\/li>\n<li>\n<p><strong>\u0418\u0441\u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u0441\u0440\u043e\u043a\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0442\u043e\u043a\u0435\u043d\u0430<\/strong> \u2014 \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0442\u043e\u043a\u0435\u043d \u0438\u0441\u0442\u0451\u043a.<\/p>\n<\/li>\n<\/ol>\n<p>\u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u044d\u0442\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c:<\/p>\n<pre><code class=\"xml\">&lt;smart-captcha   [sitekey]=\"'YOUR_SITE_KEY'\"   (networkError)=\"handleNetworkError()\"   (javascriptError)=\"handleJsError($event)\"   (tokenExpired)=\"handleTokenExpired()\" \/&gt; <\/code><\/pre>\n<h3>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u0432\u0438\u0434\u0430<\/h3>\n<p>\u042f\u043d\u0434\u0435\u043a\u0441 SmartCaptcha \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u0432\u0438\u0434\u0430:<\/p>\n<ol>\n<li>\n<p>\u041c\u043e\u0436\u043d\u043e \u0441\u043a\u0440\u044b\u0442\u044c \u0431\u043b\u043e\u043a \u0441 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435\u043c \u043e\u0431 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0435\u0433\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"xml\">[hideShield]=\"true\"   [shieldPosition]=\"'bottom-right'\"   <\/code><\/pre>\n<ol start=\"2\">\n<li>\n<p>\u041c\u043e\u0436\u043d\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0446\u0432\u0435\u0442\u043e\u0432\u043e\u0439 \u0441\u0445\u0435\u043c\u043e\u0439 (<code>'light' | 'dark' | 'auto'<\/code>):<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"xml\">[theme]=\"'light'\" <\/code><\/pre>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u043a\u0430\u043a <a href=\"https:\/\/www.npmjs.com\/package\/@ngx-rock\/yandex-smart-captcha?activeTab=readme\" rel=\"noopener noreferrer nofollow\">npm-\u043f\u0430\u043a\u0435\u0442<\/a> \u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430 \u0432 \u043b\u044e\u0431\u043e\u0439 Angular-\u043f\u0440\u043e\u0435\u043a\u0442, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 17.3.0:<\/p>\n<pre><code class=\"bash\">npm install @ngx-rock\/yandex-smart-captcha <\/code><\/pre>\n<p>\u041f\u0440\u043e\u0435\u043a\u0442 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0442\u043a\u0440\u044b\u0442 \u0434\u043b\u044f \u0432\u043a\u043b\u0430\u0434\u043e\u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0430, \u0438 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u0438\u0442\u044c\u0441\u044f \u043a \u0435\u0433\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043d\u0430 <a href=\"https:\/\/github.com\/ngx-rock\/yandex-smart-captcha\" rel=\"noopener noreferrer nofollow\">GitHub<\/a>.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/894408\/\"> https:\/\/habr.com\/ru\/articles\/894408\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u044d\u043f\u043e\u0445\u0443 \u043c\u0430\u0441\u0441\u043e\u0432\u044b\u0445 \u0431\u043e\u0442\u043d\u0435\u0442\u043e\u0432 \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0430\u0442\u0430\u043a \u0437\u0430\u0449\u0438\u0442\u0430 \u0432\u0435\u0431-\u0444\u043e\u0440\u043c \u0441\u0442\u0430\u043b\u0430 \u043d\u0435\u043e\u0442\u044a\u0435\u043c\u043b\u0435\u043c\u043e\u0439 \u0447\u0430\u0441\u0442\u044c\u044e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0430 \u044d\u0442\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0434\u043b\u044f \u0440\u043e\u0441\u0441\u0438\u0439\u0441\u043a\u0438\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u043f\u043e\u0441\u043b\u0435 \u0443\u0445\u043e\u0434\u0430 \u043c\u043d\u043e\u0433\u0438\u0445 \u0437\u0430\u0440\u0443\u0431\u0435\u0436\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0441 \u0440\u044b\u043d\u043a\u0430. \u041e\u0434\u043d\u0438\u043c \u0438\u0437 \u043e\u0442\u0435\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439, \u043f\u0440\u0438\u0437\u0432\u0430\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0432\u0448\u0443\u044e\u0441\u044f \u043d\u0438\u0448\u0443, \u0441\u0442\u0430\u043b\u0430 \u042f\u043d\u0434\u0435\u043a\u0441 SmartCaptcha \u2014 \u0440\u043e\u0441\u0441\u0438\u0439\u0441\u043a\u0430\u044f \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0430 Google reCAPTCHA.<\/p>\n<p>\u0425\u043e\u0442\u044f \u042f\u043d\u0434\u0435\u043a\u0441 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0434\u043b\u044f React, \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0441 Angular \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u0438\u043b\u0438\u0439.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u044b \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e Angular-\u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0430, \u0435\u0433\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u0438 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<figure class=\"\"><\/figure>\n<h3>\u041f\u043e\u0434\u0445\u043e\u0434 \u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438<\/h3>\n<p>\u041f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 Angular-\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044f \u0441\u0442\u0440\u0435\u043c\u0438\u043b\u0441\u044f \u0443\u0447\u0435\u0441\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0438:<\/p>\n<ol>\n<li>\n<p>\u041f\u043e\u043b\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u0441\u0435\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e JavaScript API.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 Angular-\u043f\u043e\u0434\u0445\u043e\u0434\u0430\u043c \u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0441 \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u043c\u0438 \u0444\u043e\u0440\u043c\u0430\u043c\u0438.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 Angular: \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 standalone-\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432 \u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0432 zoneless-\u0440\u0435\u0436\u0438\u043c\u0435.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u043c \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u043e\u043c (SSR).<\/p>\n<\/li>\n<\/ol>\n<h3>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/h3>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u0432\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430:<\/p>\n<ol>\n<li>\n<p><strong>SmartCaptchaComponent<\/strong> \u2014 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u043a\u0430\u043f\u0447\u0430 \u0441 \u0432\u0438\u0434\u0438\u043c\u044b\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435.<\/p>\n<\/li>\n<li>\n<p><strong>InvisibleSmartCaptchaComponent<\/strong> \u2014 \u043d\u0435\u0432\u0438\u0434\u0438\u043c\u0430\u044f \u043a\u0430\u043f\u0447\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e.<\/p>\n<\/li>\n<\/ol>\n<p>\u041e\u0431\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b <code>ControlValueAccessor<\/code> \u0438 <code>Validator<\/code>, \u0447\u0442\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0431\u0435\u0441\u0448\u043e\u0432\u043d\u0443\u044e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u0441 \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u043c\u0438 \u0444\u043e\u0440\u043c\u0430\u043c\u0438 Angular.<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f<\/h3>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0432 \u0444\u043e\u0440\u043c\u0435:<\/p>\n<pre><code class=\"typescript\">import { Component } from '@angular\/core'; import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular\/forms'; import { SmartCaptchaComponent } from '@ngx-rock\/yandex-smart-captcha';  @Component({   selector: 'app-contact-form',   standalone: true,   imports: [ReactiveFormsModule, SmartCaptchaComponent],   template: `     &lt;form [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\"&gt;       &lt;div class=\"form-group\"&gt;         &lt;label for=\"email\"&gt;\u041f\u043e\u0447\u0442\u0430&lt;\/label&gt;         &lt;input type=\"text\" id=\"email\" formControlName=\"email\"&gt;       &lt;\/div&gt;              &lt;div class=\"form-group\"&gt;         &lt;smart-captcha           formControlName=\"captcha\"           [sitekey]=\"'YOUR_SITE_KEY'\"           (success)=\"onCaptchaSuccess($event)\"         \/&gt;       &lt;\/div&gt;              &lt;button type=\"submit\" [disabled]=\"form.invalid\"&gt;\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c&lt;\/button&gt;     &lt;\/form&gt;   ` }) export class ContactFormComponent {   form: FormGroup;      constructor(private fb: FormBuilder) {     this.form = this.fb.group({       email: ['', Validators.required],       captcha: [null, Validators.required]     });   }      onCaptchaSuccess(token: string): void {     console.log('\u041a\u0430\u043f\u0447\u0430 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043f\u0440\u043e\u0439\u0434\u0435\u043d\u0430:', token);   }      onSubmit(): void {     if (this.form.valid) {       const formData = this.form.value;       \/\/ formData.captcha \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0442\u043e\u043a\u0435\u043d \u043a\u0430\u043f\u0447\u0438     }   } } <\/code><\/pre>\n<h3>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0435\u0432\u0438\u0434\u0438\u043c\u043e\u0439 \u043a\u0430\u043f\u0447\u0438<\/h3>\n<p>\u041d\u0435\u0432\u0438\u0434\u0438\u043c\u0430\u044f \u043a\u0430\u043f\u0447\u0430 (invisible captcha) \u2014 \u043e\u0441\u043e\u0431\u044b\u0439 \u0440\u0435\u0436\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u044b, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439. \u042d\u0442\u043e\u0442 \u0440\u0435\u0436\u0438\u043c \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043f\u043e\u043b\u0435\u0437\u0435\u043d \u0434\u043b\u044f \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0432\u0435\u0440\u0441\u0438\u0438 \u0444\u043e\u0440\u043c, \u0433\u0434\u0435 \u043b\u0438\u0448\u043d\u0438\u0435 \u0448\u0430\u0433\u0438 \u043c\u043e\u0433\u0443\u0442 \u043e\u0442\u043f\u0443\u0433\u043d\u0443\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.<\/p>\n<p>\u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0435\u0432\u0438\u0434\u0438\u043c\u043e\u0439 \u043a\u0430\u043f\u0447\u0438 \u0432 Angular:<\/p>\n<pre><code class=\"typescript\">&lt;form [formGroup]=\"form\" (ngSubmit)=\"submitForm()\"&gt;   &lt;!-- \u0414\u0440\u0443\u0433\u0438\u0435 \u043f\u043e\u043b\u044f \u0444\u043e\u0440\u043c\u044b --&gt;      &lt;invisible-smart-captcha     formControlName=\"captcha\"     [sitekey]=\"'YOUR_SITE_KEY'\"     [visible]=\"submitAttempted\"     (success)=\"onCaptchaSuccess($event)\"   \/&gt;      &lt;button type=\"submit\"&gt;\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c&lt;\/button&gt; &lt;\/form&gt; <\/code><\/pre>\n<pre><code class=\"typescript\">submitForm(): void {   this.submitAttempted = true; \/\/ \u042d\u0442\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442 \u043d\u0435\u0432\u0438\u0434\u0438\u043c\u0443\u044e \u043a\u0430\u043f\u0447\u0443      \/\/ \u0424\u043e\u0440\u043c\u0430 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043a\u0430\u043f\u0447\u0438   \/\/ \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0442\u043e\u043a\u0435\u043d\u0430 (\u0447\u0435\u0440\u0435\u0437 onCaptchaSuccess) }  onCaptchaSuccess(token: string): void {   this.apiService.sendFormWithCaptcha(this.form.value, token)     .subscribe(response =&gt; {       \/\/ \u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043e\u0442\u0432\u0435\u0442\u0430     }); } <\/code><\/pre>\n<h3>\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043e\u0448\u0438\u0431\u043e\u043a \u0438 \u0433\u0440\u0430\u043d\u0438\u0447\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432<\/h3>\n<p>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u0432\u043d\u0435\u0448\u043d\u0438\u043c\u0438 API \u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u0432\u044f\u0437\u0430\u043d\u0430 \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u043c\u0438 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438. \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432:<\/p>\n<ol>\n<li>\n<p><strong>\u0421\u0435\u0442\u0435\u0432\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438<\/strong> \u2014 \u043a\u043e\u0433\u0434\u0430 \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d.<\/p>\n<\/li>\n<li>\n<p><strong>JavaScript-\u043e\u0448\u0438\u0431\u043a\u0438<\/strong> \u2014 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0449\u0438\u0435 \u0432 \u043a\u043e\u0434\u0435 \u043a\u0430\u043f\u0447\u0438.<\/p>\n<\/li>\n<li>\n<p><strong>\u0418\u0441\u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u0441\u0440\u043e\u043a\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0442\u043e\u043a\u0435\u043d\u0430<\/strong> \u2014 \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0442\u043e\u043a\u0435\u043d \u0438\u0441\u0442\u0451\u043a.<\/p>\n<\/li>\n<\/ol>\n<p>\u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u044d\u0442\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c:<\/p>\n<pre><code class=\"xml\">&lt;smart-captcha   [sitekey]=\"'YOUR_SITE_KEY'\"   (networkError)=\"handleNetworkError()\"   (javascriptError)=\"handleJsError($event)\"   (tokenExpired)=\"handleTokenExpired()\" \/&gt; <\/code><\/pre>\n<h3>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u0432\u0438\u0434\u0430<\/h3>\n<p>\u042f\u043d\u0434\u0435\u043a\u0441 SmartCaptcha \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u0432\u0438\u0434\u0430:<\/p>\n<ol>\n<li>\n<p>\u041c\u043e\u0436\u043d\u043e \u0441\u043a\u0440\u044b\u0442\u044c \u0431\u043b\u043e\u043a \u0441 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435\u043c \u043e\u0431 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0435\u0433\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"xml\">[hideShield]=\"true\"   [shieldPosition]=\"'bottom-right'\"   <\/code><\/pre>\n<ol start=\"2\">\n<li>\n<p>\u041c\u043e\u0436\u043d\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0446\u0432\u0435\u0442\u043e\u0432\u043e\u0439 \u0441\u0445\u0435\u043c\u043e\u0439 (<code>'light' | 'dark' | 'auto'<\/code>):<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"xml\">[theme]=\"'light'\" <\/code><\/pre>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u043a\u0430\u043a <a href=\"https:\/\/www.npmjs.com\/package\/@ngx-rock\/yandex-smart-captcha?activeTab=readme\" rel=\"noopener noreferrer nofollow\">npm-\u043f\u0430\u043a\u0435\u0442<\/a> \u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430 \u0432 \u043b\u044e\u0431\u043e\u0439 Angular-\u043f\u0440\u043e\u0435\u043a\u0442, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 17.3.0:<\/p>\n<pre><code class=\"bash\">npm install @ngx-rock\/yandex-smart-captcha <\/code><\/pre>\n<p>\u041f\u0440\u043e\u0435\u043a\u0442 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0442\u043a\u0440\u044b\u0442 \u0434\u043b\u044f \u0432\u043a\u043b\u0430\u0434\u043e\u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0430, \u0438 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u0438\u0442\u044c\u0441\u044f \u043a \u0435\u0433\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043d\u0430 <a href=\"https:\/\/github.com\/ngx-rock\/yandex-smart-captcha\" rel=\"noopener noreferrer nofollow\">GitHub<\/a>.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/894408\/\"> https:\/\/habr.com\/ru\/articles\/894408\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-454089","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/454089","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=454089"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/454089\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=454089"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=454089"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=454089"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}